Skip to content

Commit

Permalink
docs: add more prefer-destructuring examples with array destructuring (
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjermanovic committed Jul 4, 2023
1 parent 0052374 commit 138c096
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/src/rules/prefer-destructuring.md
Expand Up @@ -38,6 +38,7 @@ Examples of **incorrect** code for this rule:
```javascript
// With `array` enabled
var foo = array[0];
bar.baz = array[0];

// With `object` enabled
var foo = object.foo;
Expand All @@ -54,6 +55,8 @@ Examples of **correct** code for this rule:
// With `array` enabled
var [ foo ] = array;
var foo = array[someIndex];
[bar.baz] = array;


// With `object` enabled
var { foo } = object;
Expand Down

0 comments on commit 138c096

Please sign in to comment.