From 9b8ae52aebc8a2501c0c6dfe3da00ac9270357a7 Mon Sep 17 00:00:00 2001 From: doepy <8428487+doepy@user.noreply.gitee.com> Date: Sun, 2 May 2021 22:36:50 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=96=B0=E5=BB=BA=203=E7=8F=AD=5F=E9=99=B6?= =?UTF-8?q?=E5=86=B6=5F=E7=AC=AC=E5=8D=81=E5=85=AB=E5=91=A8?= 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 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250/.keep" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250/.keep" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250/.keep" new file mode 100644 index 00000000..e69de29b -- Gitee From 2be7746fb7cc57d2d452f1c966304bf2931d69f5 Mon Sep 17 00:00:00 2001 From: doepy <8428487+doepy@user.noreply.gitee.com> Date: Sun, 2 May 2021 22:37:13 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=96=B0=E5=BB=BA=203=E7=8F=AD=5F=E9=99=B6?= =?UTF-8?q?=E5=86=B6=5F=E7=AC=AC=E5=8D=81=E5=85=AB=E5=91=A8=5F=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E8=8A=82?= 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 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202/.keep" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202/.keep" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202/.keep" new file mode 100644 index 00000000..e69de29b -- Gitee From 0d3ec2f4dabc58173e6874d2776779a484dd62a8 Mon Sep 17 00:00:00 2001 From: doepy <8428487+doepy@user.noreply.gitee.com> Date: Sun, 2 May 2021 22:37:22 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=96=B0=E5=BB=BA=203=E7=8F=AD=5F=E9=99=B6?= =?UTF-8?q?=E5=86=B6=5F=E7=AC=AC=E5=8D=81=E5=85=AB=E5=91=A8=5F=E7=AC=AC?= =?UTF-8?q?=E4=BA=8C=E8=8A=82?= 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 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250_\347\254\254\344\272\214\350\212\202/.keep" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250_\347\254\254\344\272\214\350\212\202/.keep" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250_\347\254\254\344\272\214\350\212\202/.keep" new file mode 100644 index 00000000..e69de29b -- Gitee From 86b5cd28e49f3edecfaef7226c235ca9db45450d Mon Sep 17 00:00:00 2001 From: doepy <8428487+doepy@user.noreply.gitee.com> Date: Sun, 2 May 2021 22:37:30 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E6=96=B0=E5=BB=BA=203=E7=8F=AD=5F=E9=99=B6?= =?UTF-8?q?=E5=86=B6=5F=E7=AC=AC=E5=8D=81=E5=85=AB=E5=91=A8=5F=E7=AC=AC?= =?UTF-8?q?=E4=B8=89=E8=8A=82?= 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 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250_\347\254\254\344\270\211\350\212\202/.keep" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250_\347\254\254\344\270\211\350\212\202/.keep" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250_\347\254\254\344\270\211\350\212\202/.keep" new file mode 100644 index 00000000..e69de29b -- Gitee From a35978812fb49be680be62b1fe48aa4992509d30 Mon Sep 17 00:00:00 2001 From: doepy <8428487+doepy@user.noreply.gitee.com> Date: Sun, 2 May 2021 22:41:40 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E7=AC=AC=E5=8D=81=E5=85=AB=E5=91=A8=20?= =?UTF-8?q?=E7=AC=AC=E5=8D=81=E5=85=AB=E5=91=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../week20_1practice.js" | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202/week20_1practice.js" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202/week20_1practice.js" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202/week20_1practice.js" new file mode 100644 index 00000000..4a87169e --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202/week20_1practice.js" @@ -0,0 +1,51 @@ +a = 1 +1 +var a = 1 +undefined +let a = 1 +undefined +a +1 +const NAME = "tuann" +undefined +NAME = "chihahi" +function foo(){ + let a = 2; + let b; + return a=3, b=4, b +} +undefined +foo() +4 +Math.random() +0.3633741885409343 +parseInt(Math.random()*100) +48 +parseInt(Math.random()*100) +40 +maxNum = 90 +90 +minNum = 20 +20 +parseInt(Math.random()*(maxNum-minNum)) + minNum +81 +parseInt(Math.random()*(maxNum-minNum)) + minNum +43 +parseInt(Math.random()*(maxNum-minNum)) + minNum +79 +parseInt(Math.random()*(maxNum-minNum)) + minNum +22 +foo = (function(minNum, maxNum){ + console.log(parseInt(Math.random()*(maxNum-minNum)) + minNum) +}) +ƒ (minNum, maxNum){ + console.log(parseInt(Math.random()*(maxNum-minNum)) + minNum) +} +console.log(foo) +VM3451:1 ƒ (minNum, maxNum){ + console.log(parseInt(Math.random()*(maxNum-minNum)) + minNum) +} +undefined +foo = (function(minNum, maxNum){ + console.log(parseInt(Math.random()*(maxNum-minNum)) + minNum) +})(minNum:20 , maxNum:90) \ No newline at end of file -- Gitee From b219a7baae3b9bb39ae574c0de4d54f3e5cb61cf Mon Sep 17 00:00:00 2001 From: doepy <8428487+doepy@user.noreply.gitee.com> Date: Sun, 2 May 2021 22:41:57 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E7=AC=AC=E5=8D=81=E5=85=AB=E5=91=A8=20?= =?UTF-8?q?=E7=AC=AC=E5=8D=81=E5=85=AB=E5=91=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../week20_2practice.js" | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250_\347\254\254\344\272\214\350\212\202/week20_2practice.js" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250_\347\254\254\344\272\214\350\212\202/week20_2practice.js" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250_\347\254\254\344\272\214\350\212\202/week20_2practice.js" new file mode 100644 index 00000000..2b1d55f8 --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250_\347\254\254\344\272\214\350\212\202/week20_2practice.js" @@ -0,0 +1,57 @@ +//命名规范: 类和构造函数使用大驼峰命名法 +function Dog (){ + this.color = 'black' +} +// 私有属性用_表示 +function Dog (){ + this.color = 'black' + this._owner = 'tunan' +} +//单行注释 +/* 多行注释 +* +* */ +//基本数据类型 1,undefined +typeof False +"undefined" // 返回undifined的原因是js中false是小写的 +//基本数据类型 2,boolean +typeof false +//基本数据类型 3,number +typeof 1 +typeof 1.0 +//基本数据类型 4,Bigint +typeof 1n + +//基本数据类型 5,String +typeof '2' +//基本数据类型 6,Symbol +a = Symbol(1) +b = Symbol(2) +a === b +>false +//基本数据类型 7,null +// null和undefined区别:null表示一个空指针,undefined表示‘无0这样一个值’ +//基本数据类型 8,Object 一种类似字典,用键对值表示属性关系的数据类型,键是字符串或者Symbol +let obj = {undefined: 1 , false: 2 , 1:3 , 1n:4 , '1':5} + +//基本数据类型 9,Function + +//基本数据结构 1,对象 --表面像字典,本质和python中类相似 +let obj = {undefined: 1 , false: 2 , 1:3 , 1n:4 , '1':5} //直接声明 +//通过new一个对象 +function Dog(){ + this.color = 'balck' +} +new Dog() + +//基本数据结构 2,数组 --类似python中的list,但是扩容机制有区别 +let myArray = [1,2] +myArray[3] = 'a' +//Uint8Array -表示8位无符号正兴数组 +let myArray = new Uint8Array() +//Uint16Array Uint32Array +//基本数据结构 Map --认为是有序的字典 +let myMap = new Map() +//基本数据结构 Set +let mySet = new Set + -- Gitee From 3f9afb8bbba344a6ec94dd901c7243956df91edb Mon Sep 17 00:00:00 2001 From: doepy <8428487+doepy@user.noreply.gitee.com> Date: Sun, 2 May 2021 22:42:16 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E7=AC=AC=E5=8D=81=E5=85=AB=E5=91=A8=20?= =?UTF-8?q?=E7=AC=AC=E5=8D=81=E5=85=AB=E5=91=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../week20_3practice.js" | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250_\347\254\254\344\270\211\350\212\202/week20_3practice.js" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250_\347\254\254\344\270\211\350\212\202/week20_3practice.js" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250_\347\254\254\344\270\211\350\212\202/week20_3practice.js" new file mode 100644 index 00000000..41469db7 --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250/3\347\217\255_\351\231\266\345\206\266_\347\254\254\345\215\201\345\205\253\345\221\250_\347\254\254\344\270\211\350\212\202/week20_3practice.js" @@ -0,0 +1,61 @@ +//数据类型的CURD +//字符串 +s = 'abc' //单引号 +s = "abc" //双引号 +s = `abc +aa` //如果有特殊的空白字符,使用``符号 +//合并字符串 +s += '2' +string.length //获取字符串的长度 +myString[index] //通过索引获取单个字符 +myString.slice[start, end] //切片获取子字符串 +myString.indexOf("a") +//在js中判断当前字符是否在字符串中,会通过一下方式 +if(-myString.index("a")){ + +} + +s.replace("object", "test") +s.replaceAll //替换所以匹配的子字符串 + +//Delete +let s = "test" +`get string => ${s}` +>>"get string => test" + +//数组 +let myArray = [1, 2, 3] +let myArray2 = Array.from(myArray) //复制一个数组 +let myArray3 = myArray.concat(myArray2) //合并两个数组 + +myArray.length //查看数组的长度 +myArray.[index] //通过索引获取单个元素 +myArray.slice(start, end) //通过切片获取子数组 +myArray.indexOf(value) //通过元素获取当前索引值 + +myArray[index] = newvalue //通过索引值进行元素替换 超过索引值不会报错 +myArray.push('c') //在数组尾部加元素 +myArray.splice(1, 0, 'd') + +myArray.splice(5, 100) //通过索引值删除,第二个元素如果有值则代表删除 +myArray.pop() // 从数组尾部删除元素 +//排序 +myArray.reverse() //倒序 +myArray.sort() //排序 +//对象 +let myObj = {'a':1, 'b':2} +let myObj2 = {'c':1, "d":4} +Object.assign(myObj, myObj2) //合并对象 +Object.key(myObj) //获取当前对象所以的key +Object.values(myObj) //获取当前对象所有的values +Object.defineProperty(navigator, 'webdriver',{value:true, writable:true}) //键对值赋值 + +delete myObj.a //删除 +JSON.stringify(myObj) //json转换 object > string +let jsonDate = JSON.stringify(myObj) +JSON.parse(jsonDate) //string >object + +//date模块操作 +new Date() //获取当前时间 +new Date().toISOString() //时间格式化 +new Date().getTime() //精确到毫秒 \ No newline at end of file -- Gitee