Advice to all Python users: learn JavaScript

comments (single view)

i already did, it’s cool but i want 1/0 to actually raise an error

too bad, js only has a catch-all Number type, so Infinity is the right response for 1/0

JS has Error types, it can throw them. In fact, they can throw them inside the / operator itself. Watch.

x = {valueOf:1}
1/x
View all comments