From 8ba6ac21096e640740315310d1a800ca526dda81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E8=80=80=E4=BB=81?= <1579614208@qq.com> Date: Sat, 22 Oct 2022 16:29:50 +0000 Subject: [PATCH 1/7] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=2040=E5=BC=A0?= =?UTF-8?q?=E8=80=80=E4=BB=81/=E4=BD=9C=E4=B8=9A/1015=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=AC=A1=E6=AC=A1=E4=BD=9C=E4=B8=9A=20=E4=B8=BA=2040=E5=BC=A0?= =?UTF-8?q?=E8=80=80=E4=BB=81/=E4=BD=9C=E4=B8=9A/1017=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=AC=A1=E6=AC=A1=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ZY.HTML" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "40\345\274\240\350\200\200\344\273\201/\344\275\234\344\270\232/1015\347\254\254\344\270\211\346\254\241\346\254\241\344\275\234\344\270\232/ZY.HTML" => "40\345\274\240\350\200\200\344\273\201/\344\275\234\344\270\232/1017\347\254\254\344\270\211\346\254\241\346\254\241\344\275\234\344\270\232/ZY.HTML" (100%) diff --git "a/40\345\274\240\350\200\200\344\273\201/\344\275\234\344\270\232/1015\347\254\254\344\270\211\346\254\241\346\254\241\344\275\234\344\270\232/ZY.HTML" "b/40\345\274\240\350\200\200\344\273\201/\344\275\234\344\270\232/1017\347\254\254\344\270\211\346\254\241\346\254\241\344\275\234\344\270\232/ZY.HTML" similarity index 100% rename from "40\345\274\240\350\200\200\344\273\201/\344\275\234\344\270\232/1015\347\254\254\344\270\211\346\254\241\346\254\241\344\275\234\344\270\232/ZY.HTML" rename to "40\345\274\240\350\200\200\344\273\201/\344\275\234\344\270\232/1017\347\254\254\344\270\211\346\254\241\346\254\241\344\275\234\344\270\232/ZY.HTML" -- Gitee From a293a7ec26bd62a078472e78e4698273ef9bba17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E8=80=80=E4=BB=81?= <1579614208@qq.com> Date: Wed, 26 Oct 2022 03:23:31 +0000 Subject: [PATCH 2/7] =?UTF-8?q?=E5=BC=A0=E8=80=80=E4=BB=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张耀仁 <1579614208@qq.com> --- ...\346\254\241\344\275\234\344\270\232.html" | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 "40\345\274\240\350\200\200\344\273\201/\344\275\234\344\270\232/1022\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232/\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232.html" diff --git "a/40\345\274\240\350\200\200\344\273\201/\344\275\234\344\270\232/1022\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232/\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232.html" "b/40\345\274\240\350\200\200\344\273\201/\344\275\234\344\270\232/1022\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232/\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232.html" new file mode 100644 index 0000000..e05d5fc --- /dev/null +++ "b/40\345\274\240\350\200\200\344\273\201/\344\275\234\344\270\232/1022\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232/\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232.html" @@ -0,0 +1,53 @@ + + + + + + + Document + + + + + \ No newline at end of file -- Gitee From 6a210bd2f7c24c32d4980faf7bcfd889747b121b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E8=80=80=E4=BB=81?= <1579614208@qq.com> Date: Wed, 26 Oct 2022 03:23:58 +0000 Subject: [PATCH 3/7] =?UTF-8?q?=E5=BC=A0=E8=80=80=E4=BB=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张耀仁 <1579614208@qq.com> --- ...3\346\254\241\347\254\224\350\256\260.txt" | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 "40\345\274\240\350\200\200\344\273\201/\347\254\224\350\256\260/1022\347\254\254\345\233\233\346\254\241\347\254\224\350\256\260/1022\347\254\254\345\233\233\346\254\241\347\254\224\350\256\260.txt" diff --git "a/40\345\274\240\350\200\200\344\273\201/\347\254\224\350\256\260/1022\347\254\254\345\233\233\346\254\241\347\254\224\350\256\260/1022\347\254\254\345\233\233\346\254\241\347\254\224\350\256\260.txt" "b/40\345\274\240\350\200\200\344\273\201/\347\254\224\350\256\260/1022\347\254\254\345\233\233\346\254\241\347\254\224\350\256\260/1022\347\254\254\345\233\233\346\254\241\347\254\224\350\256\260.txt" new file mode 100644 index 0000000..d48466c --- /dev/null +++ "b/40\345\274\240\350\200\200\344\273\201/\347\254\224\350\256\260/1022\347\254\254\345\233\233\346\254\241\347\254\224\350\256\260/1022\347\254\254\345\233\233\346\254\241\347\254\224\350\256\260.txt" @@ -0,0 +1,111 @@ +JavaScript 函数语法 +函数就是包裹在花括号中的代码块,前面使用了关键词 function: + +局部 JavaScript 变量 +在 JavaScript 函数内部声明的变量(使用 var)是局部变量,所以只能在函数内部访问它。(该变量的作用域是局部的)。 +您可以在不同的函数中使用名称相同的局部变量,因为只有声明过该变量的函数才能识别出该变量。 +只要函数运行完毕,本地变量就会被删除。 + +全局 JavaScript 变量 +在函数外声明的变量是全局变量,网页上的所有脚本和函数都能访问它。 + + + +局部变量会在函数运行以后被删除。 + +全局变量会在页面关闭后被删除 + + +concat:连接,数组合并 + const arr = [1,2,3] + const arr1 = [4,5,6] + + const new_arr = [...arr,...arr1] + const new_arr = arr.concat(arr1); + console.log(arr); + console.log(arr1); + console.log(new_arr); + + + join:将数组转成字符串 + const arr = [1, 2, 3, 4, 5, 6] + console.log(arr.join); + var str = arr.join(',') + console.log(str); + + string.split('')将字符串转成数组 + var text = + `I love teaching and empowering people. I teach HTML, CSS, JS, React, Python.` + 将上述字符串去除标点空格后统计有多少个单词 + const arr1 = text.split('.').join('').split(',').join('').split(' ') + + 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); + + 将数组的单词全转为大写 + const countries = ['Finland', 'Sweden', 'Norway', 'Denmark', 'Iceland'] + const new_countries = countries.map( + function (e){ + return e.toUpperCase() + } + ) + console.log(new_countries); + + filter过滤:返回数组中符合条件的数据 + const new_arr = arr.filter( + function (e){ + return e%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); + + +some() + +例: var isMatch = arr.some( + function (e){ + return e==6 + } + ) + console.log(isMatch); +箭头函数: var aa = (形参列表) => {函数体} arrow function + +函数只有一个return语句时,省略{}和return关键字,直接写返回值 + +无返回值,一般不用箭头函数 + + + every():只要有一个false,返回 + +二维数组 + const arrayOfArray = [[1, 2, 3], [4, 5, 6]] + 增删改查 + console.log(arrayOfArray[1][1]); + + 删 + arrayOfArray[1].splice(1,1) + console.log(arrayOfArray); \ No newline at end of file -- Gitee From 9f86cd05190a061e75d310c693b92ff68a1df9b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E8=80=80=E4=BB=81?= <1579614208@qq.com> Date: Wed, 26 Oct 2022 03:26:05 +0000 Subject: [PATCH 4/7] =?UTF-8?q?=E5=BC=A0=E8=80=80=E4=BB=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张耀仁 <1579614208@qq.com> --- ...\346\254\241\344\275\234\344\270\232.html" | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 "40\345\274\240\350\200\200\344\273\201/\344\275\234\344\270\232/1024\347\254\254\344\272\224\346\254\241\344\275\234\344\270\232/\347\254\254\344\272\224\346\254\241\344\275\234\344\270\232.html" diff --git "a/40\345\274\240\350\200\200\344\273\201/\344\275\234\344\270\232/1024\347\254\254\344\272\224\346\254\241\344\275\234\344\270\232/\347\254\254\344\272\224\346\254\241\344\275\234\344\270\232.html" "b/40\345\274\240\350\200\200\344\273\201/\344\275\234\344\270\232/1024\347\254\254\344\272\224\346\254\241\344\275\234\344\270\232/\347\254\254\344\272\224\346\254\241\344\275\234\344\270\232.html" new file mode 100644 index 0000000..19038ef --- /dev/null +++ "b/40\345\274\240\350\200\200\344\273\201/\344\275\234\344\270\232/1024\347\254\254\344\272\224\346\254\241\344\275\234\344\270\232/\347\254\254\344\272\224\346\254\241\344\275\234\344\270\232.html" @@ -0,0 +1,65 @@ + + + + + + + Document + + + + + + \ No newline at end of file -- Gitee From 8de1b2f4330d3b6e17764d97b1ea7146d78b0bbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E8=80=80=E4=BB=81?= <1579614208@qq.com> Date: Wed, 26 Oct 2022 03:26:36 +0000 Subject: [PATCH 5/7] =?UTF-8?q?=E5=BC=A0=E8=80=80=E4=BB=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张耀仁 <1579614208@qq.com> --- ...4\346\254\241\347\254\224\350\256\260.txt" | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 "40\345\274\240\350\200\200\344\273\201/\347\254\224\350\256\260/1024\347\254\254\344\272\224\346\254\241\347\254\224\350\256\260/1024\347\254\254\344\272\224\346\254\241\347\254\224\350\256\260.txt" diff --git "a/40\345\274\240\350\200\200\344\273\201/\347\254\224\350\256\260/1024\347\254\254\344\272\224\346\254\241\347\254\224\350\256\260/1024\347\254\254\344\272\224\346\254\241\347\254\224\350\256\260.txt" "b/40\345\274\240\350\200\200\344\273\201/\347\254\224\350\256\260/1024\347\254\254\344\272\224\346\254\241\347\254\224\350\256\260/1024\347\254\254\344\272\224\346\254\241\347\254\224\350\256\260.txt" new file mode 100644 index 0000000..773bc1a --- /dev/null +++ "b/40\345\274\240\350\200\200\344\273\201/\347\254\224\350\256\260/1024\347\254\254\344\272\224\346\254\241\347\254\224\350\256\260/1024\347\254\254\344\272\224\346\254\241\347\254\224\350\256\260.txt" @@ -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 From bc2d27a63b274a7e08415dfc51a233a5dd57c616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E8=80=80=E4=BB=81?= <1579614208@qq.com> Date: Thu, 27 Oct 2022 04:29:59 +0000 Subject: [PATCH 6/7] =?UTF-8?q?=E5=BC=A0=E8=80=80=E4=BB=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张耀仁 <1579614208@qq.com> --- ...\346\254\241\344\275\234\344\270\232.html" | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 "40\345\274\240\350\200\200\344\273\201/\344\275\234\344\270\232/1026\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232/\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232.html" diff --git "a/40\345\274\240\350\200\200\344\273\201/\344\275\234\344\270\232/1026\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232/\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232.html" "b/40\345\274\240\350\200\200\344\273\201/\344\275\234\344\270\232/1026\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232/\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232.html" new file mode 100644 index 0000000..13003ea --- /dev/null +++ "b/40\345\274\240\350\200\200\344\273\201/\344\275\234\344\270\232/1026\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232/\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232.html" @@ -0,0 +1,105 @@ + + + + + + + Document + + + + + \ No newline at end of file -- Gitee From 64f41225aebff7d6ef330cb6a5fdf4f5bcfa89d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E8=80=80=E4=BB=81?= <1579614208@qq.com> Date: Thu, 27 Oct 2022 04:30:17 +0000 Subject: [PATCH 7/7] =?UTF-8?q?=E5=BC=A0=E8=80=80=E4=BB=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张耀仁 <1579614208@qq.com> --- ...5\346\254\241\347\254\224\350\256\260.txt" | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 "40\345\274\240\350\200\200\344\273\201/\347\254\224\350\256\260/1026\347\254\254\345\205\255\346\254\241\347\254\224\350\256\260/\347\254\254\345\205\255\346\254\241\347\254\224\350\256\260.txt" diff --git "a/40\345\274\240\350\200\200\344\273\201/\347\254\224\350\256\260/1026\347\254\254\345\205\255\346\254\241\347\254\224\350\256\260/\347\254\254\345\205\255\346\254\241\347\254\224\350\256\260.txt" "b/40\345\274\240\350\200\200\344\273\201/\347\254\224\350\256\260/1026\347\254\254\345\205\255\346\254\241\347\254\224\350\256\260/\347\254\254\345\205\255\346\254\241\347\254\224\350\256\260.txt" new file mode 100644 index 0000000..9635dcd --- /dev/null +++ "b/40\345\274\240\350\200\200\344\273\201/\347\254\224\350\256\260/1026\347\254\254\345\205\255\346\254\241\347\254\224\350\256\260/\347\254\254\345\205\255\346\254\241\347\254\224\350\256\260.txt" @@ -0,0 +1,37 @@ +String Number Boolean + + 针对其基本数据类型的重要性和使用性, + 创建包装类来增强这三者的功能, + 使开发者能够更简单便捷的进行开发 + + 同样的包装类,每一次调用,都会产生不同的对象(对象地址的唯一性) + + + + + +拷贝 +assign:拷贝,浅拷贝(复制的是对象的地址),(手写一个对象的深拷贝)深拷贝(复制的的对象本身) + + assign:浅拷贝 + var obj2 = Object.assign(obj); + + age gender name title + assign:1.浅拷贝一个对象 2.合并对象(target,sources....) + console.log(Object.assign(obj,obj1,obj2,4,false,null,[12,3,34],{name:'张三'})); + console.log(obj[0]); + +包装类 + 原始数据类型: number, boolean, string, null, undefined (symbol,bigint) + var num = new Number(5) //对象 + num.a = 6 + num = num * 2 //会自动变成原始数据类型number + + var bol = new Boolean(); + bol.a = false + + var str = new String('abc'); + str.a = 'hi' + +包装类只有:number,boolean,string, + null,undefined是没有包装类的 \ No newline at end of file -- Gitee