JavaScript is a Class C language, and it's pretty easy for me to learn.
1 output
Console.log (* *); Equivalent to print
Console.assert (*); popup 2 variable JS is a dynamic variable similar to Python but to precede with var such as var a = 3 or 3.0 or ' name ' and so on if not add Var to the global variable is not recommended so use 3 comparison operator with ' = = ', ' = = ' Converts a variable type 4 object similar to a struct add property a.attr = *; Delete the attribute delete a.attr Delete the property called ' * * ' delete a[' * * '] 5 array operation slice: Intercept array
arr.slice(0, 3); // 从索引0开始,到索引3结束,但不包括索引3
arr.slice(3); // 从索引3开始到结束
Push and pop: add a delete element at the end of the array
Ubshift and shift: adding elements to the head of an array
Sort: Sorting
Reverse: Reverse
Splice: A common method for modifying arrays.
arr.splice(2, 3, ‘Google‘, ‘Facebook‘);
从索引2开始删除3个元素,然后再添加两个元素:
Concat: Chain join: Concatenate each element of an array with a specified symbol 6 string case: toUpperCase () and TOLOWERCASW () split: substring (1,5) Link: ' + ' or ' ***${key1}${' Key2} ' Note the quotation mark 7 condition to determine if else is equivalent to C 8 loop for (*;*;*) while doing while the same as cfor in and for-in can only show the index for to show element last foreach
var m = new Map([[1, ‘x‘], [2, ‘y‘], [3, ‘z‘]]);m.forEach(function (value, key, map) { console.log(value);});
9map set with C++stl
Dabbler Rookie Learn Web Development 2--javascript Study 1