diff --git "a/07 \345\273\226\346\262\273\345\205\210/\344\275\234\344\270\232/2022-10-17\344\275\234\344\270\232.html" "b/07 \345\273\226\346\262\273\345\205\210/\344\275\234\344\270\232/2022-10-17\344\275\234\344\270\232.html" new file mode 100644 index 0000000000000000000000000000000000000000..86d19fe701f9f6faf8d4df4d792815e8b3debbce --- /dev/null +++ "b/07 \345\273\226\346\262\273\345\205\210/\344\275\234\344\270\232/2022-10-17\344\275\234\344\270\232.html" @@ -0,0 +1,67 @@ + + + + + + + Document + + + + + + \ No newline at end of file diff --git "a/07 \345\273\226\346\262\273\345\205\210/\347\254\224\350\256\260/2022-10-17\347\254\224\350\256\260 \346\225\260\347\273\204.md" "b/07 \345\273\226\346\262\273\345\205\210/\347\254\224\350\256\260/2022-10-17\347\254\224\350\256\260 \346\225\260\347\273\204.md" new file mode 100644 index 0000000000000000000000000000000000000000..6e11aab2ba8af758ac3248b6db4fd424cd708d36 --- /dev/null +++ "b/07 \345\273\226\346\262\273\345\205\210/\347\254\224\350\256\260/2022-10-17\347\254\224\350\256\260 \346\225\260\347\273\204.md" @@ -0,0 +1,33 @@ + console.log(str.substr(4,6)); + console.log(str.substring(4,0)); // 如果start>end,交换顺序 + console.log(str.trim()); //去掉两边的空格,中间穿插的不可以 + + console.log(str.includes('Sc'));//返回true表示找得到,返回false表示找不到 + console.log(str.indexOf('Sc',6)); //返回的是第一个匹配字符串的起始下标,如果找不到返回-1 + console.log(str.slice(4,0)); //截取,返回对应长度的字符串 + +``` + // 通过冒泡排序, 从小到大 + for(let i = 0; iarr[j+1]){ + [arr[j],arr[j+1]] = [arr[j+1],arr[j]] + } + } + } +``` + +``` +重点:splice(index,delet,insert):index开始的下标,delet为删除多少个元素,insert中可以写需要添加的元素 +``` + + // arr.pop() //删除最后一个元素 + // arr.push(4,5,6) //在数组末尾添加元素 + // arr.shift() //删除第一个元素 + // arr.unshift(4,5,6) //往数组头部添加元素 + +``` +reverse():反转数组 +sort():根据字符串顺序排序,不是按照数字大小排序 +``` +