Skip to content

Commit

Permalink
Docs: Add jquery warning to prefer-destructuring (#9409)
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert authored and not-an-aardvark committed Oct 12, 2017
1 parent e835dd1 commit d7610f5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/rules/prefer-destructuring.md
Expand Up @@ -149,6 +149,14 @@ var foo = array[100];

Then the `array` part of this rule is not recommended, as destructuring does not match this use case very well.

Or for non-iterable 'array-like' objects:

```javascript
var $ = require('jquery');
var foo = $('body')[0];
var [bar] = $('body'); // fails with a TypeError
```


## Further Reading

Expand Down

0 comments on commit d7610f5

Please sign in to comment.