diff --git "a/26\350\260\242\351\207\221\351\207\221/\344\275\234\344\270\232/10.21\347\256\255\345\244\264\345\207\275\346\225\260\344\275\234\344\270\232.html" "b/26\350\260\242\351\207\221\351\207\221/\344\275\234\344\270\232/10.21\347\256\255\345\244\264\345\207\275\346\225\260\344\275\234\344\270\232.html" new file mode 100644 index 0000000000000000000000000000000000000000..7a771784a16ebb2d38bf618b1d25b0250cc664e3 --- /dev/null +++ "b/26\350\260\242\351\207\221\351\207\221/\344\275\234\344\270\232/10.21\347\256\255\345\244\264\345\207\275\346\225\260\344\275\234\344\270\232.html" @@ -0,0 +1,54 @@ + + + + + + + Document + + + + + + \ No newline at end of file diff --git "a/26\350\260\242\351\207\221\351\207\221/\344\275\234\344\270\232/10.24\345\257\271\350\261\241\344\275\234\344\270\232.html" "b/26\350\260\242\351\207\221\351\207\221/\344\275\234\344\270\232/10.24\345\257\271\350\261\241\344\275\234\344\270\232.html" new file mode 100644 index 0000000000000000000000000000000000000000..fc879819973aa81a3da4517cb7d290e1da4360c6 --- /dev/null +++ "b/26\350\260\242\351\207\221\351\207\221/\344\275\234\344\270\232/10.24\345\257\271\350\261\241\344\275\234\344\270\232.html" @@ -0,0 +1,68 @@ + + + + + + + Document + + + + + \ No newline at end of file diff --git "a/26\350\260\242\351\207\221\351\207\221/\344\275\234\344\270\232/10.26\345\214\205\350\243\205\344\275\234\344\270\232.html" "b/26\350\260\242\351\207\221\351\207\221/\344\275\234\344\270\232/10.26\345\214\205\350\243\205\344\275\234\344\270\232.html" new file mode 100644 index 0000000000000000000000000000000000000000..75bf4848ebbf0261d20d00e3d78cee6f77f57d0e --- /dev/null +++ "b/26\350\260\242\351\207\221\351\207\221/\344\275\234\344\270\232/10.26\345\214\205\350\243\205\344\275\234\344\270\232.html" @@ -0,0 +1,51 @@ + + + + + + + Document + + + + + \ No newline at end of file diff --git "a/26\350\260\242\351\207\221\351\207\221/\347\254\224\350\256\260/10.21\347\256\255\345\244\264\345\207\275\346\225\260\347\254\224\350\256\260\344\275\234\344\270\232.txt" "b/26\350\260\242\351\207\221\351\207\221/\347\254\224\350\256\260/10.21\347\256\255\345\244\264\345\207\275\346\225\260\347\254\224\350\256\260\344\275\234\344\270\232.txt" new file mode 100644 index 0000000000000000000000000000000000000000..8c0ac308d6800a507fab35f130d7a56946b65d3f --- /dev/null +++ "b/26\350\260\242\351\207\221\351\207\221/\347\254\224\350\256\260/10.21\347\256\255\345\244\264\345\207\275\346\225\260\347\254\224\350\256\260\344\275\234\344\270\232.txt" @@ -0,0 +1,30 @@ +concat:连接,数组合并 + +例: const arr = [1,2,3] const arr1 = [4,5,6] const new_arr = [...arr,...arr1]​ join:将数组转成字符串 + +例: const arr = [1, 2, 3, 4, 5, 6] console.log(arr.join); var str = arr.join(',') console.log(str); forEach(遍历数组): + +例: forEach(遍历数组) arr.forEach( //匿名函数 +function (element){ console.log(element); } ) 映射方法map(): + +例: const arr = [1, 2, 3, 4, 5, 6] const arr1 = arr.map( function (element) { return element + 1 } ) console.log(arr1); 将数组的单词全转为大写: + +数组名.toUpperCase() + +将数组的单词全转为小写: + +数组名.tolowerCase() + +filter过滤:返回数组中符合条件的数据 + +例: const new_arr = arr.filter( function (element){ return element%2==0 //true:返回 false:不符合条件=>过滤 } ) console.log(new_arr); reduce()/reduceRight():归纳汇总: 返回一个总数据 + +例: const arr = [1, 2, 3, 4, 5, 6] var sum = arr.reduceRight( function (v1,v2){ return v1*v2 } ) console.log(sum); every():只要有一个false,返回 + +例: var isMatch = arr.every( function (e){ return e>1 } ) console.log(isMatch); some() + +例: var isMatch = arr.some( function (e){ return e==6 } ) console.log(isMatch); 箭头函数: var aa = (形参列表) => {函数体} arrow function + +函数只有一个return语句时,省略{}和return关键字,直接写返回值 + +无返回值,一般不用箭头函数 \ No newline at end of file diff --git "a/26\350\260\242\351\207\221\351\207\221/\347\254\224\350\256\260/10.24\345\257\271\350\261\241\347\254\224\350\256\260.txt" "b/26\350\260\242\351\207\221\351\207\221/\347\254\224\350\256\260/10.24\345\257\271\350\261\241\347\254\224\350\256\260.txt" new file mode 100644 index 0000000000000000000000000000000000000000..808f28381710e55d9f3cb23e17f3a13334e87fe2 --- /dev/null +++ "b/26\350\260\242\351\207\221\351\207\221/\347\254\224\350\256\260/10.24\345\257\271\350\261\241\347\254\224\350\256\260.txt" @@ -0,0 +1,29 @@ +对象也是一个变量,但对象可以包含多个值(多个变量),每个值以 **name:value** 对呈现。 + +var car = {name:" ", model: , color:" "}; + + + +获取属性的值: + +数组名.变量名() + +数组名.['变量名'] + + + +对象解构: + +``` +//不使用解构 +let personName = person.name, personAge = person.age + +//使用解构:可以在一个类似对象字面量的结构中,声明多个变量。同时执行多个赋值操作 +let {name:personName, age:personAge} = person; +``` + +设定默认值:let {变量='值'} + +object.keys(): + +会返回一个由一个给定对象的自身可枚举属性组成的数组,数组中属性名的排列顺序和正常循环遍历该对象时返回的顺序一致。 \ No newline at end of file diff --git "a/26\350\260\242\351\207\221\351\207\221/\347\254\224\350\256\260/10.26\345\214\205\350\243\205\347\254\224\350\256\260.txt" "b/26\350\260\242\351\207\221\351\207\221/\347\254\224\350\256\260/10.26\345\214\205\350\243\205\347\254\224\350\256\260.txt" new file mode 100644 index 0000000000000000000000000000000000000000..a44c4a71a5d34fc7151272372811084edd7d5d82 --- /dev/null +++ "b/26\350\260\242\351\207\221\351\207\221/\347\254\224\350\256\260/10.26\345\214\205\350\243\205\347\254\224\350\256\260.txt" @@ -0,0 +1,19 @@ +assign 合并对象 + +```javascript +const obj = { a: 1 }; +const copy = Object.assign({}, obj); +console.log(copy); // { a: 1 } +``` + +包装类 :三种包装类 + + **new** **Number**(); **new** **String**(); **new** **Boolean**(); + +当对原始值进行属性赋值时,会将原始值包装成对象并赋值,但无法保存该对象,赋值完成后会立即删除对象的属性。 + +```javascript + var a = 123; + a.len = 3; // new Number(a).len = 3; delete; + console.log(a.len); // undefined +``` \ No newline at end of file