In ECMAScript, we have seven implicit types. Six of them are primitives.
The six data types that are primitives are as follows:
- Boolean.
- Number.
- String.
- Null.
- Undefined.
- Symbol—a unique identifier introduced in ECMAScript. Its purpose is to guarantee uniqueness. This is used commonly as a unique key in objects.
The seventh type is objects.
Functions and arrays are also objects. Generally, anything that is not a primitive type is an object.
Whenever you assign a value to a variable, the type is automatically determined. Based on the type, there are some rules that apply.
Primitive function arguments are passed by value. Objects are passed by reference.
Every variable is stored in memory in the form of zeros and ones. Passing by value means that the called function parameter will be copied. This means the creation of a new object that has a new reference...