@@ -216,7 +216,7 @@ Since JavaScript allows you to make objects on the fly, without a lot of class
|
216 | 216 | boilerplate, you can use an object if you are finding yourself needing a
|
217 | 217 | lot of arguments.
|
218 | 218 |
|
219 |
| -To make it obvious what properties the function expects, you can use the es6 |
| 219 | +To make it obvious what properties the function expects, you can use the ES2015/ES6 |
220 | 220 | destructuring syntax. This has a few advantages:
|
221 | 221 |
|
222 | 222 | 1. When someone looks at the function signature, it's immediately clear what
|
@@ -578,7 +578,7 @@ console.log(newName); // ['Ryan', 'McDermott'];
|
578 | 578 |
|
579 | 579 | ### Avoid Side Effects (part 2)
|
580 | 580 | In JavaScript, primitives are passed by value and objects/arrays are passed by
|
581 |
| -reference. In the case of objects and arrays, if our function makes a change |
| 581 | +reference. In the case of objects and arrays, if your function makes a change |
582 | 582 | in a shopping cart array, for example, by adding an item to purchase,
|
583 | 583 | then any other function that uses that `cart` array will be affected by this
|
584 | 584 | addition. That may be great, however it can be bad too. Let's imagine a bad
|
@@ -1456,7 +1456,7 @@ inventoryTracker.requestItems();
|
1456 | 1456 | ### Prefer ES2015/ES6 classes over ES5 plain functions
|
1457 | 1457 | It's very difficult to get readable class inheritance, construction, and method
|
1458 | 1458 | definitions for classical ES5 classes. If you need inheritance (and be aware
|
1459 |
| -that you might not), then prefer classes. However, prefer small functions over |
| 1459 | +that you might not), then prefer ES2015/ES6 classes. However, prefer small functions over |
1460 | 1460 | classes until you find yourself needing larger and more complex objects.
|
1461 | 1461 |
|
1462 | 1462 | **Bad:**
|
|
0 commit comments