3 ms·
I don't think javascript will ever be "fixed": it is as it is, if you change how hoisting works, you break everything. But: 1. You can solve that already in ES
by corecoder 10y ago
I don't think javascript will ever be "fixed": it is as it is, if you change how hoisting works, you break everything. But:
1. You can solve that already in ES6, by returning fn from a function, also avoiding the global variable;
2. Your ES3 linter should warn you about the redefined variable.