File tree Expand file tree Collapse file tree
1-js/05-data-types/03-string Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -377,8 +377,8 @@ JavaScript 中有三种获取字符串的方法:`substring`、`substr` 和 `sl
377377
378378 ```js run
379379 let str = "stringify";
380- alert( str.slice(0, 5) ); // 'strin', 从 0 到 5 的子字符串(不包括 5)
381- alert( str.slice(0, 1) ); // 's', 从 0 到 1,但不包括 1,所以只有在 0 的字符
380+ alert( str.slice(0, 5) ); // 'strin', 从 0 到 5 的子字符串(不包括 5)
381+ alert( str.slice(0, 1) ); // 's', 从 0 到 1,但不包括 1,所以只有在 0 的字符
382382 ```
383383
384384 如果没有第二个参数,`slice` 运行到字符串末尾:
@@ -413,8 +413,8 @@ JavaScript 中有三种获取字符串的方法:`substring`、`substr` 和 `sl
413413 alert( str.substring(2, 6) ); // "ring"
414414 alert( str.substring(6, 2) ); // "ring"
415415
416- // ...但除了 slice:
417- alert( str.slice(2, 6) ); // "ring" (the same)
416+ // ...但除了 slice:
417+ alert( str.slice(2, 6) ); // "ring" (the same)
418418 alert( str.slice(6, 2) ); // "" (an empty string)
419419
420420 ```
You can’t perform that action at this time.
0 commit comments