var foo = \'bar\';
console.log(window.foo); // bar
Seems like variables get assigned as properties to this, but inside anonymous funct
They're available only in the function they're declared in.
Function scope is the only other scope in JavaScript, btw, unlike block-scoping in other {} languages.)
Re: your edit Don't be fooled--JS's this semantics are a bit irksome IMO--this may not be what you expect under a variety of circumstances.