• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Good resource that lists all of JavaScript's quirks and gotchas?

fuzzybabybunny

Moderator<br>Digital & Video Cameras
Moderator
Unfortunately every now and then I come upon a bug in my JS that I spend hours and hours debugging because I wasn't aware of certain quirks that JS has. Things like:

- "equals" / comparison operators not working as expected

- copying objects (shallow copy / deep copy / copy by reference) - this once screwed me up for DAYS

- don't using for-in loops on arrays, only on objects

I feel like it's time to just sit down and read a good resource on all of these JS gotchas.
 
Doug Crockford's "JavaScript: The Good Parts" is kind of the bible on that. It's written from the perspective of showing you the good parts of the language you should use, but while doing that, points out the bad parts that you shouldn't. There is also a relatively thick appendix with two sections that only discusses "The Bad Parts" and "The Awful Parts."
 
the first one is tricky and pretty much JS specific. it's not that they don't work as expected, it's that you don't know how they are supposed to work.

the second and third are general programming things though, nothing specific to javascript about them really.
 
Back
Top