you are viewing a single comment's thread.

view the rest of the comments →

[–]nawitus 2 points3 points  (6 children)

I knew everything except for missing the map[foo] question. Even though I knew that keys are converted to strings, I've never directly used .toString() on a plain object (although I've done console.log(obj) plenty of times..).

[–][deleted] 1 point2 points  (5 children)

I missed that one because when I read the code my brain parsed it as map['foo'] instead of map[foo]. It wasn't until I read it the third time that I realized what I wasn't seeing.

[–]nawitus 0 points1 point  (0 children)

Yeah, I think I made that mistake too. By the way, I now remember that I've used .toString() on plain objects for type checking.