19 lines
314 B
Markdown
19 lines
314 B
Markdown
# Babel and babel-preset-stage-2
|
|
|
|
If you want use the "Spead Operator" eg `...` in javascript, you need `babel-preset-stage-2`.
|
|
|
|
```shell
|
|
yarn add -D babel-preset-stage-2
|
|
```
|
|
|
|
Then enable it your babelrc :
|
|
|
|
```javascript
|
|
{
|
|
"presets": [
|
|
["es2015", { "modules": false }],
|
|
["stage-2"]
|
|
]
|
|
}
|
|
```
|