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

Const is primarily for documentation to indicate that the assignment happens only once and won't be redefined. Using 'let' or 'var' indicates to the reader that the variables value will be reassigned in the function.

It's not about the compiler.




Also let/const don't get hoisted to the start of the function, declaration using var does.




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

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

Search: