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

>If you prefix them with var they're function scoped, but there's no way to make them local to the curly braces of an "if" statement.

There is; it's just ugly. You just have to use an immediate function as the body of the if statement.



in the words of will smith in men in black, "please keep that kinda shi* to yourself"


I don't understand what you're trying to say, but I was describing a common and useful pattern.


i was complimenting you.. ahh nevermind




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

Search: