Review

In JavaScript, arrays are simply numerically indexed collections of any value-type. strings are somewhat “array-like”, but they have distinct behaviors and care must be taken if you want to treat them as arrays. Numbers in JavaScript include both “integers” and floating-point values.

Several special values are defined within the primitive types.

The null type has just one value: null, and likewise the undefined type has just the undefined value. undefined is basically the default value in any variable or property if no other value is present. The void operator lets you create the undefined value from any other value.

numbers include several special values, like NaN (supposedly “Not a Number”, but really more appropriately “invalid number”); +Infinity and -Infinity; and -0.

Simple scalar primitives (strings, numbers, etc.) are assigned/passed by value-copy, but compound values (objects, etc.) are assigned/passed by reference-copy. References are not like references/pointers in other languages — they’re never pointed at other variables/references, only at the underlying values.