From c872576c8df9dc7fba5762ec0f8d594a266be62b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B0=B8=E6=BD=98?= <1924969174@qq.com> Date: Tue, 25 Oct 2022 10:08:01 +0000 Subject: [PATCH 1/8] =?UTF-8?q?=E6=96=B0=E5=BB=BA=202022-10-13=E7=AC=AC?= =?UTF-8?q?=E5=9B=9B=E6=AC=A1=E4=BD=9C=E4=B8=9A=E6=95=B8=E7=B5=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "16\345\210\230\346\260\270\346\275\230/2022-10-13\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232\346\225\270\347\265\204/.keep" diff --git "a/16\345\210\230\346\260\270\346\275\230/2022-10-13\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232\346\225\270\347\265\204/.keep" "b/16\345\210\230\346\260\270\346\275\230/2022-10-13\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232\346\225\270\347\265\204/.keep" new file mode 100644 index 0000000..e69de29 -- Gitee From 2f053849c9cee2ba0a26f9c21644e5b4d303c156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B0=B8=E6=BD=98?= <1924969174@qq.com> Date: Tue, 25 Oct 2022 10:08:17 +0000 Subject: [PATCH 2/8] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=2016=E5=88=98?= =?UTF-8?q?=E6=B0=B8=E6=BD=98/2022-10-13=E7=AC=AC=E5=9B=9B=E6=AC=A1?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=95=B8=E7=B5=84=20=E4=B8=BA=2016=E5=88=98?= =?UTF-8?q?=E6=B0=B8=E6=BD=98/2022-10-20=E7=AC=AC=E5=9B=9B=E6=AC=A1?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=95=B8=E7=B5=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "16\345\210\230\346\260\270\346\275\230/2022-10-13\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232\346\225\270\347\265\204/.keep" => "16\345\210\230\346\260\270\346\275\230/2022-10-20\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232\346\225\270\347\265\204/.keep" (100%) diff --git "a/16\345\210\230\346\260\270\346\275\230/2022-10-13\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232\346\225\270\347\265\204/.keep" "b/16\345\210\230\346\260\270\346\275\230/2022-10-20\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232\346\225\270\347\265\204/.keep" similarity index 100% rename from "16\345\210\230\346\260\270\346\275\230/2022-10-13\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232\346\225\270\347\265\204/.keep" rename to "16\345\210\230\346\260\270\346\275\230/2022-10-20\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232\346\225\270\347\265\204/.keep" -- Gitee From 7beaf5150e6306e0d1958a469783d09251f17441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B0=B8=E6=BD=98?= <1924969174@qq.com> Date: Tue, 25 Oct 2022 10:08:46 +0000 Subject: [PATCH 3/8] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=2016=E5=88=98?= =?UTF-8?q?=E6=B0=B8=E6=BD=98/2022-10-20=E7=AC=AC=E5=9B=9B=E6=AC=A1?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=95=B8=E7=B5=84=20=E4=B8=BA=2016=E5=88=98?= =?UTF-8?q?=E6=B0=B8=E6=BD=98/2022-10-20=E7=AC=AC=E5=9B=9B=E6=AC=A1?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=95=B0=E7=B5=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "16\345\210\230\346\260\270\346\275\230/2022-10-20\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232\346\225\270\347\265\204/.keep" => "16\345\210\230\346\260\270\346\275\230/2022-10-20\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232\346\225\260\347\265\204/.keep" (100%) diff --git "a/16\345\210\230\346\260\270\346\275\230/2022-10-20\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232\346\225\270\347\265\204/.keep" "b/16\345\210\230\346\260\270\346\275\230/2022-10-20\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232\346\225\260\347\265\204/.keep" similarity index 100% rename from "16\345\210\230\346\260\270\346\275\230/2022-10-20\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232\346\225\270\347\265\204/.keep" rename to "16\345\210\230\346\260\270\346\275\230/2022-10-20\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232\346\225\260\347\265\204/.keep" -- Gitee From 2f8582937c4bf17f5e2cd26c3b7495bae1fcce78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B0=B8=E6=BD=98?= <1924969174@qq.com> Date: Tue, 25 Oct 2022 10:09:10 +0000 Subject: [PATCH 4/8] =?UTF-8?q?16=E5=88=98=E6=B0=B8=E6=BD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 刘永潘 <1924969174@qq.com> --- ...24\350\256\260\346\225\260\347\273\204.md" | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 "16\345\210\230\346\260\270\346\275\230/2022-10-20\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232\346\225\260\347\265\204/2022-10-20\347\254\254\345\233\233\346\254\241\347\254\224\350\256\260\346\225\260\347\273\204.md" diff --git "a/16\345\210\230\346\260\270\346\275\230/2022-10-20\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232\346\225\260\347\265\204/2022-10-20\347\254\254\345\233\233\346\254\241\347\254\224\350\256\260\346\225\260\347\273\204.md" "b/16\345\210\230\346\260\270\346\275\230/2022-10-20\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232\346\225\260\347\265\204/2022-10-20\347\254\254\345\233\233\346\254\241\347\254\224\350\256\260\346\225\260\347\273\204.md" new file mode 100644 index 0000000..3df2c03 --- /dev/null +++ "b/16\345\210\230\346\260\270\346\275\230/2022-10-20\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232\346\225\260\347\265\204/2022-10-20\347\254\254\345\233\233\346\254\241\347\254\224\350\256\260\346\225\260\347\273\204.md" @@ -0,0 +1,82 @@ +数组: + concat:连接,数组合并 + 例子: + const arr = [1,2,3] + const arr1 = [4,5,6] + console.log(arr1); + 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 + } + ) + + 将数组的单词全转为大写 + 例: + const countries = ['Finland', 'Sweden', 'Norway', 'Denmark', 'Iceland'] + const new_countries = countries.map( + function (e){ + return e.toUpperCase() + } + ) + 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,返回 + 例: + some() + var isMatch = arr.every( + function (e){ + return e>1 + } + ) + + var isMatch = arr.some( + function (e){ + return e==6 + } + ) + + 二维数组 + const arrayOfArray = [[1, 2, 3], [4, 5, 6]] + 增删改查 + console.log(arrayOfArray[1][1]); + + 删 + arrayOfArray[1].splice(1,1) + console.log(arrayOfArray); +函数 + 带参(形参) + undefined:变量声明了但没有赋值 + null:变量声明,并且有个空引用 + ...args:剩余运算符,将剩下的参数都放进args数组中 + function fn(A,B,...args){ + rguments:伪数组 + for (let index = 0; index < arguments.length; index++) { + console.log(arguments[index]); + } \ No newline at end of file -- Gitee From 715cd4ed2da7da359e5bcdbf3e4fb38f2aa11deb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B0=B8=E6=BD=98?= <1924969174@qq.com> Date: Tue, 25 Oct 2022 10:09:31 +0000 Subject: [PATCH 5/8] =?UTF-8?q?=E6=96=B0=E5=BB=BA=202022-10-21=E7=AC=AC?= =?UTF-8?q?=E4=BA=94=E6=AC=A1=E4=BD=9C=E4=B8=9A=E7=AE=AD=E5=A4=B4=E5=87=BD?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "16\345\210\230\346\260\270\346\275\230/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/.keep" diff --git "a/16\345\210\230\346\260\270\346\275\230/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/.keep" "b/16\345\210\230\346\260\270\346\275\230/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/.keep" new file mode 100644 index 0000000..e69de29 -- Gitee From c61df072844290fb4030685fcbd1387d168ca655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B0=B8=E6=BD=98?= <1924969174@qq.com> Date: Tue, 25 Oct 2022 10:09:49 +0000 Subject: [PATCH 6/8] =?UTF-8?q?16=E5=88=98=E6=B0=B8=E6=BD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 刘永潘 <1924969174@qq.com> --- ...\345\244\264\345\207\275\346\225\260.html" | 72 +++++++++++++++++++ ...55\345\244\264\345\207\275\346\225\260.md" | 59 +++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 "16\345\210\230\346\260\270\346\275\230/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/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.html" create mode 100644 "16\345\210\230\346\260\270\346\275\230/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/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.md" diff --git "a/16\345\210\230\346\260\270\346\275\230/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/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.html" "b/16\345\210\230\346\260\270\346\275\230/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/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.html" new file mode 100644 index 0000000..7fab855 --- /dev/null +++ "b/16\345\210\230\346\260\270\346\275\230/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/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.html" @@ -0,0 +1,72 @@ + + + + + + + Document + + + + + \ No newline at end of file diff --git "a/16\345\210\230\346\260\270\346\275\230/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/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.md" "b/16\345\210\230\346\260\270\346\275\230/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/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.md" new file mode 100644 index 0000000..df02e6b --- /dev/null +++ "b/16\345\210\230\346\260\270\346\275\230/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/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.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 From a68a6975e84938e30437c1a741ac93f40d1d43f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B0=B8=E6=BD=98?= <1924969174@qq.com> Date: Tue, 25 Oct 2022 13:04:05 +0000 Subject: [PATCH 7/8] =?UTF-8?q?=E6=96=B0=E5=BB=BA=202022-10-24=E7=AC=AC?= =?UTF-8?q?=E5=85=AD=E6=AC=A1=E4=BD=9C=E4=B8=9A=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "16\345\210\230\346\260\270\346\275\230/2022-10-24\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232\345\257\271\350\261\241/.keep" diff --git "a/16\345\210\230\346\260\270\346\275\230/2022-10-24\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232\345\257\271\350\261\241/.keep" "b/16\345\210\230\346\260\270\346\275\230/2022-10-24\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232\345\257\271\350\261\241/.keep" new file mode 100644 index 0000000..e69de29 -- Gitee From 3891574192ed704bd8047194b8a7b3aeedb583b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B0=B8=E6=BD=98?= <1924969174@qq.com> Date: Tue, 25 Oct 2022 23:22:37 +0000 Subject: [PATCH 8/8] =?UTF-8?q?16=E5=88=98=E6=B0=B8=E6=BD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 刘永潘 <1924969174@qq.com> --- ...\344\270\232\345\257\271\350\261\241.html" | 165 ++++++++++++++++++ ...24\350\256\260\345\257\271\350\261\241.md" | 81 +++++++++ 2 files changed, 246 insertions(+) create mode 100644 "16\345\210\230\346\260\270\346\275\230/2022-10-24\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232\345\257\271\350\261\241/2022-10-24\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232\345\257\271\350\261\241.html" create mode 100644 "16\345\210\230\346\260\270\346\275\230/2022-10-24\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232\345\257\271\350\261\241/2022-10-24\347\254\254\345\205\255\346\254\241\347\254\224\350\256\260\345\257\271\350\261\241.md" diff --git "a/16\345\210\230\346\260\270\346\275\230/2022-10-24\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232\345\257\271\350\261\241/2022-10-24\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232\345\257\271\350\261\241.html" "b/16\345\210\230\346\260\270\346\275\230/2022-10-24\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232\345\257\271\350\261\241/2022-10-24\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232\345\257\271\350\261\241.html" new file mode 100644 index 0000000..55933ff --- /dev/null +++ "b/16\345\210\230\346\260\270\346\275\230/2022-10-24\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232\345\257\271\350\261\241/2022-10-24\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232\345\257\271\350\261\241.html" @@ -0,0 +1,165 @@ + + + + + + + Document + + + + + \ No newline at end of file diff --git "a/16\345\210\230\346\260\270\346\275\230/2022-10-24\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232\345\257\271\350\261\241/2022-10-24\347\254\254\345\205\255\346\254\241\347\254\224\350\256\260\345\257\271\350\261\241.md" "b/16\345\210\230\346\260\270\346\275\230/2022-10-24\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232\345\257\271\350\261\241/2022-10-24\347\254\254\345\205\255\346\254\241\347\254\224\350\256\260\345\257\271\350\261\241.md" new file mode 100644 index 0000000..11e0d89 --- /dev/null +++ "b/16\345\210\230\346\260\270\346\275\230/2022-10-24\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232\345\257\271\350\261\241/2022-10-24\347\254\254\345\205\255\346\254\241\347\254\224\350\256\260\345\257\271\350\261\241.md" @@ -0,0 +1,81 @@ +对象(Objects) +万物皆对象: + +类与对象: 类:抽象的 对象:具体的人 (属性和方法) +JavaScript 的设计是一个简单的基于对象的范式。一个对象就是一系列属性的集合, +一个属性包含一个名和一个值。一个属性的值可以是函数,这种情况下属性也被称为*方法*。 + +JavaScript 对象是键值对的容器"。 + +键值对通常写法为 name : value (键与值以冒号分割)。 + +键值对在 JavaScript 对象通常称为 对象属性。 + + 访问对象属性 --person["lastName"]; --person.lastName; + + + 访问对象方法 --objectName.methodName() + +2.构造函数方式 + 1. this{} :new + 2. this赋值 (自己操作) + return this + function Students(name,age){ + this.name = name; + this.age = age; + } + + var zj = new Students('Zoe',16) + + + 3.工厂模式 (设计模式) + function GetValues(name,age) { + var that = { } + that.name = name + that.age = age + return that + } + var that = GetValues('张三',16) + console.log(typeof that); + 4.原型模式 + 5.混合模式 + + + 数组解构 + const arr = [1, 4, 5, 6, 8] + let[a,b,...args] = arr + let [a, , , , b] = arr + console.log(a, b); + + 对象解构 + var obj = { + name: '张三', + age: 16, + skill: { + sname: 'Java', + year: '2022' + } + } + + 取数据 + console.log(obj.skill[1].sname); + + let personName = obj.name, personAge = obj.age; + + 对象解构:取别名 + let{name:personName, age:personAge} = obj + console.log(personName); + console.log(personAge); + + let{name,age,job='学生'} = obj + + let name, age; + ({ name, age } = obj) + + console.log(name, age); + + + 嵌套解构 + let { name: personName, skill: { sname: skillName } } = obj + console.log(personName); + console.log(skillName); \ No newline at end of file -- Gitee