diff --git "a/38\345\274\240\345\205\210\346\235\260/\344\275\234\344\270\232/2022-11-15js\347\254\254\345\215\201\344\272\224\346\254\241\344\275\234\344\270\232.html" "b/38\345\274\240\345\205\210\346\235\260/\344\275\234\344\270\232/2022-11-15js\347\254\254\345\215\201\344\272\224\346\254\241\344\275\234\344\270\232.html" new file mode 100644 index 0000000000000000000000000000000000000000..ab592f061abc9fdb8dbfe749dde76777b729b2f8 --- /dev/null +++ "b/38\345\274\240\345\205\210\346\235\260/\344\275\234\344\270\232/2022-11-15js\347\254\254\345\215\201\344\272\224\346\254\241\344\275\234\344\270\232.html" @@ -0,0 +1,24 @@ + + + + + + + Document + + + + + + \ No newline at end of file diff --git "a/38\345\274\240\345\205\210\346\235\260/\344\275\234\344\270\232/2022-11-16js\347\254\254\345\215\201\345\205\255\346\254\241\344\275\234\344\270\232.html" "b/38\345\274\240\345\205\210\346\235\260/\344\275\234\344\270\232/2022-11-16js\347\254\254\345\215\201\345\205\255\346\254\241\344\275\234\344\270\232.html" new file mode 100644 index 0000000000000000000000000000000000000000..f60c2c6323399bfcbf6f8c0d1e1bb8f6816545be --- /dev/null +++ "b/38\345\274\240\345\205\210\346\235\260/\344\275\234\344\270\232/2022-11-16js\347\254\254\345\215\201\345\205\255\346\254\241\344\275\234\344\270\232.html" @@ -0,0 +1,25 @@ + + + + + + + Document + + + + + + \ No newline at end of file diff --git "a/38\345\274\240\345\205\210\346\235\260/\347\254\224\350\256\260/2022-11-14js\347\254\254\344\272\224\350\212\202\344\270\223\344\270\232\350\257\276.md" "b/38\345\274\240\345\205\210\346\235\260/\347\254\224\350\256\260/2022-11-14js\347\254\254\344\272\224\350\212\202\344\270\223\344\270\232\350\257\276.md" new file mode 100644 index 0000000000000000000000000000000000000000..88f4e89a2acd3489017a50e1287d7d90979773de --- /dev/null +++ "b/38\345\274\240\345\205\210\346\235\260/\347\254\224\350\256\260/2022-11-14js\347\254\254\344\272\224\350\212\202\344\270\223\344\270\232\350\257\276.md" @@ -0,0 +1,38 @@ +### this + +this产生在函数执行时 + +默认绑定:默认指向windows + +隐式绑定:谁调用,指向谁 + +显式绑定:call apply bind + +箭头函数本身没有this,里面的this指向的是父级函数中的this + +# 12、正则 + +创建正则 + + var re = /ab+c/; + var re = new RegExp("ab+c"); + +贪婪模式:能多就多 + +非贪婪模式:在正则后加?,能少就少 + +{m}:匹配m次 + +{m,n}:匹配最少m次,最多n次 + +{m,}:匹配最少m次,最多无限次 + +{1,}:1次或者多次 + + +{0,}:0次或多次 * + +{0,1}:0次或者1次 ? + +^非,在开头表示必须以下一个字符开头 + +$必须以上一个字符结尾 \ No newline at end of file diff --git "a/38\345\274\240\345\205\210\346\235\260/\347\254\224\350\256\260/2022-11-16js\347\254\254\345\215\201\345\205\255\350\212\202\344\270\223\344\270\232\350\257\276\347\254\224\350\256\260.md" "b/38\345\274\240\345\205\210\346\235\260/\347\254\224\350\256\260/2022-11-16js\347\254\254\345\215\201\345\205\255\350\212\202\344\270\223\344\270\232\350\257\276\347\254\224\350\256\260.md" new file mode 100644 index 0000000000000000000000000000000000000000..b0b098e42ac93a6648d451090502a8b8e4f584eb --- /dev/null +++ "b/38\345\274\240\345\205\210\346\235\260/\347\254\224\350\256\260/2022-11-16js\347\254\254\345\215\201\345\205\255\350\212\202\344\270\223\344\270\232\350\257\276\347\254\224\350\256\260.md" @@ -0,0 +1,26 @@ +正则 +//自左向右匹配,一旦匹配上 就不再回头(数字排列时由大到小先十位后个位) +// console.log(/[1-9][\d]|\d/.exec('9')); +//反捕获:?::将捕获到的子表达式隐藏 +//?=:紧跟着 ?!:不紧跟着 ?:-->反捕获 ??--> 非贪婪{0,1} + + +可以用括号来分隔数据 并改变类似于数组(0为要查询的的'2022-11-16'1为第一个括号框起来的数字) +// console.log(/(\d{4})-(\d{2})-(\d{2})/.exec('2022-11-16')); +可以用regExp.$1来输出第一个数字是什么,$2就是第二个 +// console.log(RegExp.$1); + +\g 全局匹配 +// console.log( '1a,2a,3a'.replace(/a/g,'b')); +\i 不区分大小写 +// console.log( '1a,2a,3a,1A'.match(/1a/ig)); +\b单词边界 +// console.log(/e\b/.exec('eapples')); +| 或者的意思 +// 文件名由字母、数字、下划线构成,不可以以数字开头,后缀为.zip/rar/gz +// console.log(/[^\d]*\.zip|rar|gz/.exec('zip.zip')); + +异常处理 +//try:尝试捕获异常,里面放的是可能出错的代码 +//1.报错之后的代码中止执行 +//2.每次只能捕获一个异常 \ No newline at end of file