[guide] Simplify the examples of 'apply vs spread' topic

This commit is contained in:
felipethome
2016-08-05 18:38:35 -03:00
parent c7d34b526a
commit 31265099af

View File

@@ -771,12 +771,12 @@ Other Style Guides
```javascript
// bad
const x = [[1, 2], [3, 4], [5, 6]];
console.log(Array.prototype.concat.apply([], x));
const x = [1, 2, 3, 4, 5];
console.log.apply(console, x);
// good
const x = [[1, 2], [3, 4], [5, 6]];
console.log([].concat(...x));
const x = [1, 2, 3, 4, 5];
console.log(...x);
// bad
new (Function.prototype.bind.apply(Date, [null, 2016, 08, 05]));