A basis,
1. Data types
1.1, classification,
1.1.1. Basic (value) Types
- String: Any character String
- Number: any Number
- boolean: true / false
- undefined: undefined
- null: null
1.1.2 Object (reference) types
- Object: any Object
- Function: a type of object that can be executed
- Array: type of object (numeric subscript, internal data ordered)
1.2, judgment,
1.2.1, typeof
- Undefined/value/string/Boolean/function
- Cannot determine: NULL and object/object and array
1.2.2, instanceof
- Determine the specific type of the object
1.2.3, = = =
- Undefined/null
1.3, problem,
1.3.1, Undefined and null?
-
Undefined means the definition has no value assigned
-
Null is defined and assigned, but the value is null
1.3.2 When do I assign a variable to NULL?
-
Initial assignment, indicating that an object will be assigned
-
Make the object garbage (to be collected by the garbage collector) before finishing
1.3.3 strict distinction between variable types and data types?
Type of data
-
Basic types of
-
Object type
The type of the variable (the type of the variable’s memory value)
-
Basic type: Save data that is the basic type
-
Reference type: Holds the address value
2. Data, variables and memory
3, objects,
4, functions,