Hacker News new | past | comments | ask | show | jobs | submit login

Yes, a function definition is hoisted too but its implementation is always hoisted together with its declaration, preventing some bugs caused by variable hoisting.

I made an example here: http://pastebin.com/2nS9EDPb

(Please correct me if I'm wrong, I wasn't aware for example that function declarations were treated as variables, redefinable etc)




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: