@@ -53,7 +53,7 @@ const yearMonthDay = moment().format('YYYY/MM/DD');
|
53 | 53 | ```
|
54 | 54 | **[⬆ back to top](#table-of-contents)**
|
55 | 55 |
|
56 |
| -### Use ES6 constants when variable values do not change |
| 56 | +### Use ES2015/ES6 constants when variable values do not change |
57 | 57 | In the bad example, the variable can be changed.
|
58 | 58 | When you declare a constant, the variable should stay
|
59 | 59 | the same throughout the program.
|
@@ -593,7 +593,7 @@ show the difference between two arrays? You could write your new function
|
593 | 593 | to the `Array.`, but it could clash with another library that tried
|
594 | 594 | to do the same thing. What if that other library was just using `diff` to find
|
595 | 595 | the difference between the first and last elements of an array? This is why it
|
596 |
| -would be much better to just use ES6 classes and simply extend the `Array` global. |
| 596 | +would be much better to just use ES2015/ES6 classes and simply extend the `Array` global. |
597 | 597 |
|
598 | 598 | **Bad:**
|
599 | 599 | ```javascript
|
@@ -1416,7 +1416,7 @@ inventoryTracker.requestItems();
|
1416 | 1416 | ```
|
1417 | 1417 | **[⬆ back to top](#table-of-contents)**
|
1418 | 1418 |
|
1419 |
| -### Prefer ES6 classes over ES5 plain functions |
| 1419 | +### Prefer ES2015/ES6 classes over ES5 plain functions |
1420 | 1420 | It's very difficult to get readable class inheritance, construction, and method
|
1421 | 1421 | definitions for classical ES5 classes. If you need inheritance (and be aware
|
1422 | 1422 | that you might not), then prefer classes. However, prefer small functions over
|
@@ -1713,7 +1713,7 @@ describe('MakeMomentJSGreatAgain', function() {
|
1713 | 1713 |
|
1714 | 1714 | ## **Concurrency**
|
1715 | 1715 | ### Use Promises, not callbacks
|
1716 |
| -Callbacks aren't clean, and they cause excessive amounts of nesting. With ES6, |
| 1716 | +Callbacks aren't clean, and they cause excessive amounts of nesting. With ES2015/ES6, |
1717 | 1717 | Promises are a built-in global type. Use them!
|
1718 | 1718 |
|
1719 | 1719 | **Bad:**
|
@@ -1752,10 +1752,10 @@ require('request-promise').get('https://en.wikipedia.org/wiki/Robert_Cecil_Marti
|
1752 | 1752 | **[⬆ back to top](#table-of-contents)**
|
1753 | 1753 |
|
1754 | 1754 | ### Async/Await are even cleaner than Promises
|
1755 |
| -Promises are a very clean alternative to callbacks, but ES7 brings async and await |
| 1755 | +Promises are a very clean alternative to callbacks, but ES2017/ES8 brings async and await |
1756 | 1756 | which offer an even cleaner solution. All you need is a function that is prefixed
|
1757 | 1757 | in an `async` keyword, and then you can write your logic imperatively without
|
1758 |
| -a `then` chain of functions. Use this if you can take advantage of ES7 features |
| 1758 | +a `then` chain of functions. Use this if you can take advantage of ES2017/ES8 features |
1759 | 1759 | today!
|
1760 | 1760 |
|
1761 | 1761 | **Bad:**
|
|
0 commit comments