12 JavaScript quirks
A core of JavaScript (the so-called “good parts”) is elegant, but that core is often obscured by quirks. This introduction is the first of a series of blog posts that looks at twelve common quirks and how to best deal with them:
A concluding post will cover ECMAScript 6 [1], which will eliminate most of the above quirks.
- Implicit conversion of values
- Two “non-values” – undefined and null
- Normal equality (==)
- Unknown variable names create global variables
- Parameter handling
- The scope of variables
- Inadvertent sharing of variables via closures
- Array-like objects
- Subtyping constructors
- Reading and writing of properties
- this in real functions
- The for-in loop
A concluding post will cover ECMAScript 6 [1], which will eliminate most of the above quirks.
The series will provide a good overview of JavaScript. It is a translation of a previous blog post in German.
ECMAScript 5 will be used and a basic knowledge of JavaScript is required, but much will be explained. I will post one quirk per week.
Reference:
Comments
Post a Comment