- Case Sensitive
- A semicolon at the end of a sentence is dispensable, but omitting a semicolon is not a good programming habit.
- Three basic data types: Numbers, text strings, and boolean values
There are two types of small data: NULL (null) and undefined (undefined). They define only one value.
Composite data types: objects, arrays, and functions
- Javascript can recognize the direct number of hexadecimal numbers. The so-called direct number of hexadecimal is started with "0x" or "0x. The ecmascript standard does not support octal, so some JavaScript supports octal, but some do not. octal is a number starting with 0. Therefore, it is best not to add a useless 0 before the number.
- Javascript has a large number of arithmetic functions. For convenience, these functions are saved as attributes of the math object. Therefore, we always use direct numbers to access these functions. For example
VaR A = math. Sin (X)
The tostring () method of the numeric type: If the parameter is not included, it is converted to decimal. If the parameter is included, it is converted to the corresponding hexadecimal format. For example
VaR A = (23). tostring (2) // convert to binary. If you call this method directly using numbers, use parentheses.
To prevent decimal point processing.
Nan is a special value that represents a non-numeric value. In particular, it is not equal to itself. To determine whether a value is Nan, use the isnan () function to detect it.
A function in JS is a data type, which means that the function can be stored in variables, arrays, and objects, and the function can also be passed as a parameter to other functions.