Skip to content

Commit 3126509

Browse files
committed
[guide] Simplify the examples of 'apply vs spread' topic
1 parent c7d34b5 commit 3126509

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -771,12 +771,12 @@ Other Style Guides
771771

772772
```javascript
773773
// bad
774-
const x = [[1, 2], [3, 4], [5, 6]];
775-
console.log(Array.prototype.concat.apply([], x));
774+
const x = [1, 2, 3, 4, 5];
775+
console.log.apply(console, x);
776776
777777
// good
778-
const x = [[1, 2], [3, 4], [5, 6]];
779-
console.log([].concat(...x));
778+
const x = [1, 2, 3, 4, 5];
779+
console.log(...x);
780780
781781
// bad
782782
new (Function.prototype.bind.apply(Date, [null, 2016, 08, 05]));

0 commit comments

Comments
 (0)