Skip to main content
table of contents
Grammar
Suggested Reading:
- “JavaScript: The Good Parts” by Douglas Crockford
- JS for Cats http://jsforcats.com/
- Java Script in 10 minutes http://spencertipping.com/js-in-ten-minutes/js-in-ten-minutes.pdf
Documentation
The official documentation is ECMAScript 262 https://www.ecma-international.org/ecma-262/.
JavaScript Quirks
- JavaScript has equality
(==)
and strict equality(===)
. The latter coerces the operands to the same time and then perform strict equality comparison. - Dot notation can be used to access object members, so can bracket notation.
- Scope of where this keyword refers to; could be global object, method object, or even more specific.
- Dynamic Typing
> typeof NaN
"number"
> 9999999999999999
10000000000000000
> 0.5+0.1==0.6
true
> 0.1+0.2==0.3
false
> Math.max()
-Infinity
> Math.min()
Infinity
> []+[]
""_
> []+{}
"[object Object]"
> {}+[]
0
>true+true+true===3
true
> true-true
0
> true==1
true
> true===1
false
> (!+[]+[]+![]).length
9
> 9+"1"
91
>91-"1"
90
> []==0
true
Annotate
Web Technology