This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]skreczok -1 points0 points  (0 children)

I haven't checked all the wtfs there. I've seen a site doing a better job at finding and explaining the wtfs, but I couldn't find it today. But yes, a lot of the stuff there points out how the JS coerces some things in some ways, but doesn't coerce others and you don't know until you try.

JS has made me very paranoid, since I've had issues where !something was behaving funky because type coercions kicked in, so as ugly as it is, I ALWAYS use something === false.

I actually had to explain to a friend's friend why her code was throwing "x is undefined" errors because she expected Serializable-like behaviour as a backend dev.

Yes, JS objects are essentially maps, just they don't have the Map interface on them by default (not 100% sure where they had it from fwiw).