Hacker News new | ask | show | jobs
by tejas1mehta 3204 days 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.