Frequently used: light blue words are optional parameters
0=false;1=true
0?1:2: True returns the first value, FALSE returns a second value
True&&false: The first value of the logical operator
typeof (Object,string ...): Identifying types in parentheses
if () {}else{}:if statement
for (Var i=0;i<x;i++) {}:for loop
Math.ceil (number) rounding up
. Floor (x) rounding down
. Round () rounding
. ABS () absolute value
. Max () 丨. Min () takes the maximum or minimum value.
parseint (String,radix) directly takes an integer to ignore the number after the decimal point
Parsefloat (String) does not ignore the number after the decimal point, but after ignoring the number of letters
Number () If the letter appears, the entire error is not recognized.
Num.tofixed (digits) digits parameters are reserved for several digits.
Usually use IndexOf
Str.search (regexp) returns the position of the result, no then returns-1
. indexof (Searchvalue,formindex) The first parameter to find the value, the second value from which to start looking for the value, no return-1
The. Match (RegExp) does not return null.
. replace (regexp| string,newstring) Replace the first argument with a regular expression or a string, and the second as a new string
. Slice (Beginnumber,endnumber) The first value is the start value and the second is the end value that returns the beginning to the end of the value, which can be inverted-1 for the last
. substr (Start,radix) slightly
The. Split () search parameter is a split symbol, which searches for the symbol in the parameter as a delimiter, and returns the individual strings separated by the result using separators
. toLowerCase () 丨 tolouppercase () conversion case
JS Basic Knowledge Memory Part (Consolidation Foundation dedicated)