From da971d944f8c20717d8bfb7532140ecfbc0a8e5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E9=87=91=E9=87=91?= <1665966989@qq.com> Date: Mon, 24 Oct 2022 06:54:54 +0000 Subject: [PATCH 1/7] =?UTF-8?q?=E8=B0=A2=E9=87=91=E9=87=9126?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 谢金金 <1665966989@qq.com> --- ...\346\225\260\344\275\234\344\270\232.html" | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 "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" 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 0000000..7a77178 --- /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 -- Gitee From e6a49d735d2ea91558927d68e1219f2f36ac4924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E9=87=91=E9=87=91?= <1665966989@qq.com> Date: Mon, 24 Oct 2022 07:28:06 +0000 Subject: [PATCH 2/7] =?UTF-8?q?=E8=B0=A2=E9=87=91=E9=87=9126?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 谢金金 <1665966989@qq.com> --- ...71\350\261\241\347\254\224\350\256\260.md" | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 "26\350\260\242\351\207\221\351\207\221/\344\275\234\344\270\232/10.21\346\225\260\347\273\204\302\267\345\222\214\345\257\271\350\261\241\347\254\224\350\256\260.md" diff --git "a/26\350\260\242\351\207\221\351\207\221/\344\275\234\344\270\232/10.21\346\225\260\347\273\204\302\267\345\222\214\345\257\271\350\261\241\347\254\224\350\256\260.md" "b/26\350\260\242\351\207\221\351\207\221/\344\275\234\344\270\232/10.21\346\225\260\347\273\204\302\267\345\222\214\345\257\271\350\261\241\347\254\224\350\256\260.md" new file mode 100644 index 0000000..151ac77 --- /dev/null +++ "b/26\350\260\242\351\207\221\351\207\221/\344\275\234\344\270\232/10.21\346\225\260\347\273\204\302\267\345\222\214\345\257\271\350\261\241\347\254\224\350\256\260.md" @@ -0,0 +1,75 @@ +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 -- Gitee From 4278f018006e6d7beca264a6279366b8ffb272a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E9=87=91=E9=87=91?= <1665966989@qq.com> Date: Thu, 27 Oct 2022 03:49:26 +0000 Subject: [PATCH 3/7] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=2026?= =?UTF-8?q?=E8=B0=A2=E9=87=91=E9=87=91/=E4=BD=9C=E4=B8=9A/10.21=E6=95=B0?= =?UTF-8?q?=E7=BB=84=C2=B7=E5=92=8C=E5=AF=B9=E8=B1=A1=E7=AC=94=E8=AE=B0.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...71\350\261\241\347\254\224\350\256\260.md" | 75 ------------------- 1 file changed, 75 deletions(-) delete mode 100644 "26\350\260\242\351\207\221\351\207\221/\344\275\234\344\270\232/10.21\346\225\260\347\273\204\302\267\345\222\214\345\257\271\350\261\241\347\254\224\350\256\260.md" diff --git "a/26\350\260\242\351\207\221\351\207\221/\344\275\234\344\270\232/10.21\346\225\260\347\273\204\302\267\345\222\214\345\257\271\350\261\241\347\254\224\350\256\260.md" "b/26\350\260\242\351\207\221\351\207\221/\344\275\234\344\270\232/10.21\346\225\260\347\273\204\302\267\345\222\214\345\257\271\350\261\241\347\254\224\350\256\260.md" deleted file mode 100644 index 151ac77..0000000 --- "a/26\350\260\242\351\207\221\351\207\221/\344\275\234\344\270\232/10.21\346\225\260\347\273\204\302\267\345\222\214\345\257\271\350\261\241\347\254\224\350\256\260.md" +++ /dev/null @@ -1,75 +0,0 @@ -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 -- Gitee From 8cdf41480744399f0642c14e20442dceded1dc3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E9=87=91=E9=87=91?= <1665966989@qq.com> Date: Thu, 27 Oct 2022 03:49:42 +0000 Subject: [PATCH 4/7] =?UTF-8?q?=E8=B0=A2=E9=87=91=E9=87=9126?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 谢金金 <1665966989@qq.com> --- ...4\350\256\260\344\275\234\344\270\232.txt" | 30 +++++++++++++++++++ ...1\350\261\241\347\254\224\350\256\260.txt" | 29 ++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 "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" create mode 100644 "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" 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 0000000..8c0ac30 --- /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 0000000..808f283 --- /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 -- Gitee From 492073a4d967ad269862069152f6a5a39800f6bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E9=87=91=E9=87=91?= <1665966989@qq.com> Date: Thu, 27 Oct 2022 03:50:09 +0000 Subject: [PATCH 5/7] =?UTF-8?q?=E8=B0=A2=E9=87=91=E9=87=9126?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 谢金金 <1665966989@qq.com> --- ...\350\261\241\344\275\234\344\270\232.html" | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 "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" 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 0000000..fc87981 --- /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 -- Gitee From 8d0e5482fd311a3998f0c471bab64f34573449b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E9=87=91=E9=87=91?= <1665966989@qq.com> Date: Thu, 27 Oct 2022 04:13:29 +0000 Subject: [PATCH 6/7] =?UTF-8?q?=E8=B0=A2=E9=87=91=E9=87=9126?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 谢金金 <1665966989@qq.com> --- ...\350\243\205\344\275\234\344\270\232.html" | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 "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" 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 0000000..75bf484 --- /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 -- Gitee From b23f55c7c38eca8a6272eba69749c7b59fcad679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E9=87=91=E9=87=91?= <1665966989@qq.com> Date: Thu, 27 Oct 2022 04:18:36 +0000 Subject: [PATCH 7/7] =?UTF-8?q?=E8=B0=A2=E9=87=91=E9=87=9126?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 谢金金 <1665966989@qq.com> --- ...5\350\243\205\347\254\224\350\256\260.txt" | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 "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" 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 0000000..a44c4a7 --- /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 -- Gitee