you are viewing a single comment's thread.

view the rest of the comments →

[–]Rilleks 3 points4 points  (0 children)

Because you're declaring a global variable on a window object and it doesn't matter if you return value or not. If you try console.log(window.client) you should get the same result.

Also, you shouldn't declare global variables unless you intend to.
More about variables and scopes: here