Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

nothing about context, then function called in expressions

var a = { b:function(){...}}; a.b() // a var c = false; (c || a.b)() // window

this context is always global



That's a needlessly complicated example. You could just write (function(){alert(this)})() -- and in fact, that's what was the very first example.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: