Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: ... is not an operator #11232

Merged
merged 2 commits into from Feb 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/rules/prefer-spread.md
@@ -1,4 +1,4 @@
# Suggest using the spread operator instead of `.apply()`. (prefer-spread)
# Suggest using spread syntax instead of `.apply()`. (prefer-spread)

Before ES2015, one must use `Function.prototype.apply()` to call variadic functions.

Expand All @@ -7,7 +7,7 @@ var args = [1, 2, 3, 4];
Math.max.apply(Math, args);
```

In ES2015, one can use the spread operator to call variadic functions.
In ES2015, one can use spread syntax to call variadic functions.

```js
/*eslint-env es6*/
Expand All @@ -18,7 +18,7 @@ Math.max(...args);

## Rule Details

This rule is aimed to flag usage of `Function.prototype.apply()` in situations where the spread operator could be used instead.
This rule is aimed to flag usage of `Function.prototype.apply()` in situations where spread syntax could be used instead.

## Examples

Expand All @@ -37,7 +37,7 @@ Examples of **correct** code for this rule:
```js
/*eslint prefer-spread: "error"*/

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

Expand Down