1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-25 03:02:21 +00:00

Merge branch 'gh-pages' of github.com:ruanyf/es6tutorial into gh-pages

This commit is contained in:
ruanyf 2017-08-24 10:21:04 +08:00
commit c7b7e9736c

View File

@ -232,8 +232,8 @@ ES6 提供字符串实例的`normalize()`方法,用来将字符的不同表示
传统上JavaScript只有`indexOf`方法可以用来确定一个字符串是否包含在另一个字符串中。ES6又提供了三种新方法。
- **includes()**:返回布尔值,表示是否找到了参数字符串。
- **startsWith()**:返回布尔值,表示参数字符串是否在字符串的头部。
- **endsWith()**:返回布尔值,表示参数字符串是否在字符串的尾部。
- **startsWith()**:返回布尔值,表示参数字符串是否在字符串的头部。
- **endsWith()**:返回布尔值,表示参数字符串是否在字符串的尾部。
```javascript
var s = 'Hello world!';