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