3 ms·
Undefined, that's hoisting. I think it is dirty, but the point of the var statement (and your hoisting example) is that you implicitly imply the variable scope
by JimmaDaRustla 14y ago
Undefined, that's hoisting.
I think it is dirty, but the point of the var statement (and your hoisting example) is that you implicitly imply the variable scope. In Coffeescript, you just do an assignment and it will be function scope if it (the variable) doesn't exist in any parent scopes? That seems dirtier to me and dangerous.
If you are awesome and namespacing and keeping clean/modular/maintainable code, Coffeescript may work great.
- JimmaDaRustla 14y agoSomeone correct me if I'm wrong, because I'm not a pro by any means: var statement allows for implied variable scope and avoid variable collisions from parent scopes