0. JavaScript's simple data types include numbers, character A, Boolean values (True/false), NULL, and undefined values, and other values are objects.
1. JavaScript has only one numeric type, which is represented internally as a 64-bit floating-point number. No integers are separated, so the values of 1 and 1.0 are the same.
2, Nan is a numeric value that represents a result of an operation that does not produce a normal result. Nan is not equal to any value, including itself. You can use the function isNaN (number) to detect Nan, but it is recommended to use Isfinite () to detect whether a value is a number.
- typeof NaN = = = ' Number '//true
- Nan = = = Nan//false
- Nan!== nan//true
- IsNaN (0) IsNaN (' 0′)//false
- IsNaN (NaN) IsNaN (' oops ')//true
3. JavaScript has no character type. To represent a character, you simply create a string that contains only one character, and once created, it is immutable. When created, Unicode is a 16-bit character set, so all characters in JavaScript are 16-bit.
4, False, null, undefined, empty string, 0, Nan are all considered false. Other values are true, including ' false ', and the new Boolean (false).
5. The values generated by the TypeOf operator are: ' Number ', ' String ', ' Boolean ', ' undefined ', ' function ', ' object '. Returns ' object ' for arrays or null,typeof.
6. If the first operand is a false,&& returns the value of the first operand, and vice versa, returns the second; if the first operand is true, | | Returns the value of the first operand, and vice versa, returns a second;
7. Arguments has a length property, but not an array, and it does not have any array of methods.
8. Methods for handling the regular: Regexp.exec (), Regexp.test (), String.match (), String.Replace (), String.search (), and String.Split () " See also: JavaScript regular expression "
9, the regular expression factor: \/[] () {}? + * | . ^ $. To match a factor, escape with \ In the literal, and double-write \ In the RegExp object. Note \ Prefixes do not make letters or numbers literal.
10. Grouping of regular expressions
- Capture type: A captured grouping is a branch of a regular expression enclosed in parentheses. Any characters that match this grouping will be captured. Each captured group is assigned a number. 1 is the first capturing group, 2 is the second one, and so on.
- Non-capturing type: Non-capturing group band?: prefix. It only makes a simple match, does not capture matching text, and does not interfere with the numbering of the capturing type grouping
- Forward positive match: with a = prefix, similar to a non-capturing grouping, but after this group match, the text will fall back to where it started, and it doesn't actually match anything.
- Forward negative match: Band?! Prefix, similar to a forward positive match, but it continues to match only if it fails to match
11. Interesting examples of = =
- ' = = ' 0 '//false
- 0 = = "//false"
- 0 = = ' 0 '//true
- False = = ' false '//false
- false = = ' 0′//true
- false = = undefined//false
- false = = NULL//false
- Null = = undefined//true
- ' \t\r\n ' = = 0//true
The notes of the JavaScript language essence