Primitive valuesPrimitives are immutable: there is no way to change (or “mutate”) a primitive value. Primitives are also compared by value: two values are the same only if they have the same value. The primitive values are:
- Numbers, strings, or booleans.
- null and undefined.
|Overflow||It could be either:Infinity or -Infinity|
|Infinity as one operand||It could be either:Infinity or -Infinity|
|Division by Zero||It could be either:Infinity or -Infinity|
|undefined, null, 0, –0, NaN, ""||false|
|All other values, including all objects (and arrays)||true|
null and undefinedBoth does not neither properties nor methods and indicate an absence of value. Comparing both using “==” we will get “true”
|Description||It is a language keyword||It is the value of variables that have not been initialized. The value you get when you query the value of an object property or array element that does not exist. It is also returned by functions that have no return value, and the value of function parameters for which no argument is supplied.|
|Represent||Program-level, normal, or expected absence of value||system-level, unexpected, or error-like absence of value|
It is a collection of properties where each property has a name and a value. an unordered collection of named values. It is mutable.
|Array||Represents an ordered collection of numbered values.|
|Function||A function is an object that has executable code associated with it.|
|Date||Defines objects that represent dates.|
|RegExp||Defines objects that represent regular expressions.|