6 ms·
I'm pretty sure we could skip some of the worst ones, such as the interrelations of type coercion and equality. Variable hoisting isn't as big a deal with let,
by ebiester 2y ago
I'm pretty sure we could skip some of the worst ones, such as the interrelations of type coercion and equality. Variable hoisting isn't as big a deal with let, but we could remove that entirely. We could align null and undefined.
We could fix parseint. Instanceof/typeof could align with expectations. Array could be a first class type, and we could have a split between floating point and integer.
We could force global scope to be intentional, with some sort of global keyword. We could get rid of optional semicolons and go one way or the other. We could get rid if "==".
I think cleaning up equality would do the best for bug removal, but with what we've learned over the last 30 years we absolutely could clean up the worst sources of confusion.