3 ms·
I like the function scope as it encourages you to create functions. functions are great! Only time it gets confusing is in the for-loop where most people expect
by z3t4 9y ago
I like the function scope as it encourages you to create functions. functions are great! Only time it gets confusing is in the for-loop where most people expect a closure. I tell them to just put the innards of the for-loop in a function.
Also with function scope you don't have to worry about the blocks, you can declare variables everywhere and they'll be hoisted.