JavaScript WTFs
March 30, 2012 [JavaScript, Programming Languages, Tech]I recently did a presentation at work on "surprising" things you may encounter in JavaScript. I present it here for your delectation:
Sorting arrays was the one that wasted me the most time. Arrays in JavaScript are a neat hack on top of objects. Given that, presumably, all modern implementations have a separate type for an array as opposed to an object, you would hope that at some point they would grow up into something really different in the language.
You can watch the videos here: JavaScript WTFs videos
Comments
andyb 2024-11-28
Thanks, glad you enjoyed it!
jeffjohnsondicc 2024-11-28
JavaScript quirks never fail to surprise! Sorting arrays being tied to their object-like nature is a classic “gotcha.” Your presentation must have been enlightening for many devs navigating these nuances. It’s a reminder that even mature languages have their peculiarities, keeping us learning and on our toes. Great insight! 🚀
Regards,
DICC INSTITUTE