From db4a1d2accef2fa340ea2c03e529182f59a660d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=96=87=E9=BE=99?= <2717752887@qq.com> Date: Mon, 24 Oct 2022 03:22:27 +0000 Subject: [PATCH 1/3] =?UTF-8?q?2022-10.21=E7=AC=AC=E4=BA=94=E6=AC=A1?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴文龙 <2717752887@qq.com> --- ...\345\222\214\345\257\271\350\261\241.html" | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 "17\345\220\264\346\226\207\351\276\231/\344\275\234\344\270\232/2022-10-21\347\254\254\344\272\224\346\254\241\344\275\234\344\270\232\347\256\255\345\244\264\345\207\275\346\225\260\345\222\214\345\257\271\350\261\241.html" diff --git "a/17\345\220\264\346\226\207\351\276\231/\344\275\234\344\270\232/2022-10-21\347\254\254\344\272\224\346\254\241\344\275\234\344\270\232\347\256\255\345\244\264\345\207\275\346\225\260\345\222\214\345\257\271\350\261\241.html" "b/17\345\220\264\346\226\207\351\276\231/\344\275\234\344\270\232/2022-10-21\347\254\254\344\272\224\346\254\241\344\275\234\344\270\232\347\256\255\345\244\264\345\207\275\346\225\260\345\222\214\345\257\271\350\261\241.html" new file mode 100644 index 0000000..b99334c --- /dev/null +++ "b/17\345\220\264\346\226\207\351\276\231/\344\275\234\344\270\232/2022-10-21\347\254\254\344\272\224\346\254\241\344\275\234\344\270\232\347\256\255\345\244\264\345\207\275\346\225\260\345\222\214\345\257\271\350\261\241.html" @@ -0,0 +1,63 @@ + + + + + + + Document + + + + + \ No newline at end of file -- Gitee From 9709b9c5abbe8b342607d6ad7c1c3efa41d8ee73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=96=87=E9=BE=99?= <2717752887@qq.com> Date: Mon, 24 Oct 2022 03:23:37 +0000 Subject: [PATCH 2/3] =?UTF-8?q?2022-10.20=E7=AC=AC=E5=9B=9B=E6=AC=A1?= =?UTF-8?q?=E7=AC=94=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴文龙 <2717752887@qq.com> --- ...33\346\254\241\347\254\224\350\256\260.md" | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 "17\345\220\264\346\226\207\351\276\231/\347\254\224\350\256\260/2022-10.20\347\254\254\345\233\233\346\254\241\347\254\224\350\256\260.md" diff --git "a/17\345\220\264\346\226\207\351\276\231/\347\254\224\350\256\260/2022-10.20\347\254\254\345\233\233\346\254\241\347\254\224\350\256\260.md" "b/17\345\220\264\346\226\207\351\276\231/\347\254\224\350\256\260/2022-10.20\347\254\254\345\233\233\346\254\241\347\254\224\350\256\260.md" new file mode 100644 index 0000000..85a6f2d --- /dev/null +++ "b/17\345\220\264\346\226\207\351\276\231/\347\254\224\350\256\260/2022-10.20\347\254\254\345\233\233\346\254\241\347\254\224\350\256\260.md" @@ -0,0 +1,106 @@ +# 数组 + +concat:连接,合并数组 + +const arr = [1,2,3] const arr1 = [4,5,6] + +const new_arr = arr.concat(arr1); + + + +...args:剩余运算符,将剩下的参数都放进args数组中 + +连接数组也可以用args:const new_arr = [...arr,...arr1] + + + +join:将数组转化成字符串 + +const arr = [1, 2, 3, 4, 5, 6] + +console.log(arr.join); + +var str = arr.join(',') 括号里的用来隔开每个元素 + + + +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 + + } + + ) + + + +filter过滤:返回数组中符合条件的数据 + +const new_arr = arr.filter( + +​ function (e){ + +​ return e%2==0 //true:返回 false:不符合条件=>过滤 + +​ } + + ) + + + +reduce(),reduceRight():归纳汇总: 返回一个总数据 + + const arr = [1, 2, 3, 4, 5, 6] + +​ var sum = arr.reduceRight( + +​ function (v1,v2){ + +​ return v1*v2 + +​ } + +​ ) + + + +​ every():只要有一个false,返回false + +​ var isMatch = arr.every( + +​ function (e){ + +​ return e>1 + +​ } + +​ ) + + + + + + + -- Gitee From 4656531b2efd95591e4d8598e9bdb91c49f75bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=96=87=E9=BE=99?= <2717752887@qq.com> Date: Mon, 24 Oct 2022 03:24:26 +0000 Subject: [PATCH 3/3] =?UTF-8?q?2022-10.21=E7=AC=AC=E4=BA=94=E6=AC=A1?= =?UTF-8?q?=E7=AC=94=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴文龙 <2717752887@qq.com> --- ...24\346\254\241\347\254\224\350\256\260.md" | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 "17\345\220\264\346\226\207\351\276\231/\347\254\224\350\256\260/2022-10-21\347\254\254\344\272\224\346\254\241\347\254\224\350\256\260.md" diff --git "a/17\345\220\264\346\226\207\351\276\231/\347\254\224\350\256\260/2022-10-21\347\254\254\344\272\224\346\254\241\347\254\224\350\256\260.md" "b/17\345\220\264\346\226\207\351\276\231/\347\254\224\350\256\260/2022-10-21\347\254\254\344\272\224\346\254\241\347\254\224\350\256\260.md" new file mode 100644 index 0000000..df02e6b --- /dev/null +++ "b/17\345\220\264\346\226\207\351\276\231/\347\254\224\350\256\260/2022-10-21\347\254\254\344\272\224\346\254\241\347\254\224\350\256\260.md" @@ -0,0 +1,59 @@ +函数: + 匿名函数: function (){} + 箭头函数:var aa = (形参列表) => {函数体} arrow function + + 无返回值,一般不用箭头函数 + 如果箭头函数返回一个对象,那么需要在对象外面加上括号 + 例: + var aa = function (n1, n2) { + var sum = n1 + n2 + return sum; + } + 箭头: + var bb = (n1, n2) => { + var sum = n1 + n2; + return n1+n2; + } + var cc = (n1, n2) => n1 + n2; //函数只有一个return语句时,省略{}和return关键字,直接写返回值 + 当函数只有一个形参时,可以省略圆括号 + var dd = (num) => { + var res = 1; + for (var i = 1; i <= num; i++) { + res *= i; + } + return console.log(res);; + } + + var ee = () => '这是一个箭头函数'; //无参时,圆括号不可以省略 +对象: + 对象: 类(人类,鱼类,鸟类) 万物对象:属性和行为 + 字面量表达式创建对象 + var obj = { + name:{ + firstName:'李', + lastName:'华' + }, + age:18, + 'qq number': 4619163491 + } + 属性:增删改查 + + 1.查 . 一级属性 二级属性往后[][] + 1.1查 使用 [] + console.log(obj['name']['lastName']); + 增 obj.原来obj中没有的属性,相当于将该属性添加到对象obj中 + obj.gender = '男' + console.log(obj); + + 删 delete 一般删之前要对该属性进行判断 + delete obj.age + console.log(obj); + + 构造函数 = new 对象 + + 普通函数命名规则:小驼峰:getName() + 构造函数命名规则:大驼峰:GetName() + var obj = new GetName() //生成了一个对象 + console.log(obj.age); + + \ No newline at end of file -- Gitee