doc: add ES7 stage 3 features

This commit is contained in:
ruanyf
2016-02-09 09:23:29 +08:00
parent 0be4b18312
commit 40437de61a
6 changed files with 420 additions and 15 deletions
+7
View File
@@ -318,6 +318,13 @@ ES7推出了字符串补全长度的功能。如果某个字符串不够指定
'xxx'.padEnd(2, 'ab') // 'xxx'
```
如果用来补全的字符串与原字符串,两者的长度之和超过了制定的最小长度,则会截去超出位数的补全字符串。
```javascript
'abc'.padStart(10, '0123456789')
// '0123456abc'
```
如果省略第二个参数,则会用空格补全长度。
```javascript