Any value that represents just itself and isn’t stored
Booleans, objects, arrays, functions, regular expressions, and the
undefined as literals.
Any developer-defined location for storing data
created by using the
Each of these data storage locations has a particular cost associated with reading and writing operations involving the data. In most cases, the performance difference between accessing information from a literal value versus a local variable is trivial. Accessing information from array items and object members is more expensive, though exactly which is more expensive depends heavily on the browser. Figure 2-1 shows the relative speed of accessing 200,000 values from each of these four ...