Ten Oddities And Secrets About JavaScript
JavaScript. At once bizarre and yet beautiful, it is surely the programming language that Pablo Picasso would have invented. Null is apparently an object, an empty array is apparently equal to false
, and functions are bandied around as though they were tennis balls.
1. Null is an Object
2. NaN is a Number
3. An Array With No Keys == False (About Truthy and Falsy)
4. replace() Can Accept a Callback Function
5. Regular Expressions: More Than Just Match and Replace
6. You Can Fake Scope
7. Functions Can Execute Themselves
8. Firefox Reads and Returns Colors in RGB, Not Hex
9. 0.1 + 0.2 !== 0.3
10. Undefined Can Be Defined