Avoid the word "mutate" while explaining const

This commit is contained in:
jpersson
2015-11-17 13:12:02 -05:00
parent 60480c05ea
commit a3495e07f4

View File

@@ -89,7 +89,7 @@ Other Style Guides
- [2.1](#2.1) <a name='2.1'></a> Use `const` for all of your references; avoid using `var`.
> Why? This ensures that you can't reassign your references (mutation), which can lead to bugs and difficult to comprehend code.
> Why? This ensures that you can't reassign your references, which can lead to bugs and difficult to comprehend code.
```javascript
// bad
@@ -101,7 +101,7 @@ Other Style Guides
const b = 2;
```
- [2.2](#2.2) <a name='2.2'></a> If you must mutate references, use `let` instead of `var`.
- [2.2](#2.2) <a name='2.2'></a> If you must reassign references, use `let` instead of `var`.
> Why? `let` is block-scoped rather than function-scoped like `var`.