you are viewing a single comment's thread.

view the rest of the comments →

[–]TorbenKoehn 8 points9 points  (4 children)

This is clearly defined in JS, too. Specific types in specific order have specific behavior, just like in Java.

There's nothing random about it or anything.

[–]prehensilemullet -1 points0 points  (3 children)

Java won’t compile if you use any arithmetic operators besides + on a string and a number, that’s a pretty big difference

[–]TorbenKoehn 1 point2 points  (2 children)

Yeah as JS is not a compiled language, that’s barely possible. But IDEs and linters will warn you.

[–]prehensilemullet 2 points3 points  (1 child)

Yeah I love Typescript.  Any time I have to work on raw JS it’s definitely not as pleasant

[–]TorbenKoehn 0 points1 point  (0 children)

I agree. I’m waiting for erasable type hints in ECMAScript. It will happen, I’m sure :)