Chapter III types, values, and variables
Content Essentials
I. Data type
1. Types of values that can be represented and manipulated in a programming language are called data types
The 2.JS data types fall into two categories:
Primitive types: Numbers, strings, and Boolean values
Object type
There are two special primitive values in 3.JS: null (NULL) and undefined (undefined)
4. Object: is a collection of attributes (property), each of which consists of a name/value pair.
5. Function: Another special object defined in JS. A function is an object that has executable code associated with it, runs executable code by calling a function, and returns the result of the operation.
6. Constructors:
If a function is used to initialize (using the new operator) a newly created object, we call it a constructor.
Each constructor defines a class (Class) object, in addition to the array class and function class, JS also defines the date (data) class that represents the Date object, and the regular (REGEXP) class defines the expression regular expression object. The error class defines objects that express run-time errors and syntax in the JS program.
The 7.JS interpreter has its own memory management mechanism that can automatically garbage-collect memory. This means that the program can create objects on demand, and programmers don't have to worry about destroying them and memory recycling. When there is no longer any reference to an object, the interpreter will know that the object is useless, and then automatically reclaim the memory resources it consumes.
"JS Authoritative Guide Learning Summary-Chapter III types, values and variables"