Javascript data types (symbol)
1. 6 primitive data types or basic data types
1, undefined (1, the statement is not assigned, 2, the function has no return value)
2,null (empty, does not exist)
3,number (numbers, decimals and integers)
4,boolean (Boolean value, true, false)
5,string (string, single quote or double (Quotation means)
6, es6 symbol original data type uses Symbol() to generate a unique value, you can pass the parameter Symbol('dd'), string class, does not affect its value; use ## as an attribute value #This was an error in the initial implementation of JavaScript and was later used by ECMAScript. Today we can explain that null is a placeholder for a non-existent object, but we still need to pay attention to this feature when actually coding.
ECMAScript believes that undefined is derived from null, so they are defined as equal. of. However, what should we do if in some cases we must distinguish between these two values? The following two methods can be used.
1, object The object object is an unordered property set. The "property" here can be a basic value, object or function
2, Array array
3, function function
5, object is the parent of all reference types
The difference between original data types and reference data types:
1. Simple data segment
2. Stored value (stack)
Reference data type
1. Object composed of multiple values
2. Stored address (heap)
The above is the detailed content of What should novices know about learning js?. For more information, please follow other related articles on the PHP Chinese website!