5 ms·
I think the right response for such an operation would be to throw a runtime error as opposed to coercing it into an integer. That's what a lot of other languag
by tejas1mehta 9y ago
I think the right response for such an operation would be to throw a runtime error as opposed to coercing it into an integer. That's what a lot of other languages like ruby do. While I understand JS' philosophy of dynamic typing and coercion rather than runtime errors. I think this is taking it too far.