Skip to content

Commit

Permalink
Docs: Add an example for the spread operator to prefer-spread.md (#7802
Browse files Browse the repository at this point in the history
…) (#7804)

* Spread example to the docs for prefer-spread

* small whitespace mistake in prefer-spread.md

* removed excess whitespace per vitorbal's comment

* making whitespace more consistant
  • Loading branch information
butlermd authored and not-an-aardvark committed Dec 22, 2016
1 parent b8ce2dc commit b938f1f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/rules/prefer-spread.md
Expand Up @@ -30,9 +30,7 @@ Examples of **incorrect** code for this rule:
/*eslint prefer-spread: "error"*/

foo.apply(undefined, args);

foo.apply(null, args);

obj.foo.apply(obj, args);
```

Expand All @@ -41,6 +39,10 @@ Examples of **correct** code for this rule:
```js
/*eslint prefer-spread: "error"*/

// Using the spread operator
foo(...args);
obj.foo(...args);

// The `this` binding is different.
foo.apply(obj, args);
obj.foo.apply(null, args);
Expand Down

0 comments on commit b938f1f

Please sign in to comment.