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

It's a way of hiding local variables. Old "var" variables are function scoped, so you can't even hide them in if-blocks or for-blocks, which makes scope leakage even worse.

If you're a JS programmer you should definitely read Crockford's famous JS book, it explains a lot of JS patterns and the rationale behind them.



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

Search: