4 ms·
Once you learn that fact, and then avoid ever using function name() {} definitions, you will never have the problem of confusing hoisting actually happen to
by tomxor 9y ago
Once you learn that fact, and then avoid ever using
function name() {}
definitions, you will never have the problem of confusing hoisting actually happen to you...
Yes var had it's own set of problems (which you could argue make the alternative of assigning functions to variables bad) causing unexpected bugs but those have in turn been solved very well by const and let... and just like function names, there is also no reason to use var now.