3 ms·
> I must redundantly ensure you know this number is a number! Even though you can easily convert it to one if you need to, and move on! Yay I don't get where y
by jallen_dot_dev 3y ago
> I must redundantly ensure you know this number is a number! Even though you can easily convert it to one if you need to, and move on! Yay
I don't get where you're coming from. Yeah you can easily convert something to a number[1], so isn't it a good idea to force a dev to do that easy conversion by emitting a compile-time error if they don't? Because if they don't, and the value doesn't get coerced correctly, then the code blows up at runtime.
[1] Except when you can't and you get NaN