mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-28 21:32:20 +00:00
Merge branch 'gh-pages' of github.com:ruanyf/es6tutorial into gh-pages
This commit is contained in:
commit
be282bd913
@ -520,7 +520,7 @@ function f([(z)]) { return z; }
|
||||
([a]) = [5];
|
||||
```
|
||||
|
||||
上面代码将整个模式放在模式之中,导致报错。
|
||||
上面代码将整个模式放在圆括号之中,导致报错。
|
||||
|
||||
```javascript
|
||||
// 报错
|
||||
|
@ -395,7 +395,7 @@ $ npm install --save-dev babelify babel-preset-es2015
|
||||
|
||||
```bash
|
||||
$ browserify script.js -o bundle.js \
|
||||
-t [ babelify --presets [ es2015 react ] ]
|
||||
-t [ babelify --presets [ es2015 ] ]
|
||||
```
|
||||
|
||||
上面代码将ES6脚本`script.js`,转为`bundle.js`,浏览器直接加载后者就可以了。
|
||||
|
@ -133,7 +133,7 @@ String.fromCodePoint(0x78, 0x1f680, 0x79) === 'x\uD83D\uDE80y'
|
||||
// true
|
||||
```
|
||||
|
||||
上面代码中,如果`String.fromCharCode`方法有多个参数,则它们会被合并成一个字符串返回。
|
||||
上面代码中,如果`String.fromCodePoint`方法有多个参数,则它们会被合并成一个字符串返回。
|
||||
|
||||
注意,`fromCodePoint`方法定义在`String`对象上,而`codePointAt`方法定义在字符串的实例对象上。
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user