add example [skip ci]

This commit is contained in:
Henry Zhu
2016-11-29 08:32:46 -05:00
committed by GitHub
parent 287ee0fda8
commit f3e4b9a7b7

View File

@@ -1,6 +1,26 @@
# babel-plugin-check-es2015-constants
Validate ES2015 constants
Validate ES2015 constants (prevents reassignment of const variables).
## Example
**In**
```js
const a = 1;
a = 2;
```
**Out**
```bash
repl: "a" is read-only
1 | const a = 1;
> 2 | a = 2;
| ^
```
[Try in REPL](http://babeljs.io/repl/#?babili=false&evaluate=true&lineWrap=false&presets=es2015&experimental=false&loose=false&spec=false&code=const%20a%20%3D%201%3B%0Aa%20%3D%202%3B&playground=true)
## Installation