Skip to content

Commit 138c096

Browse files
authored
docs: add more prefer-destructuring examples with array destructuring (#17330)
Fixes #17327
1 parent 0052374 commit 138c096

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

docs/src/rules/prefer-destructuring.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Examples of **incorrect** code for this rule:
3838
```javascript
3939
// With `array` enabled
4040
var foo = array[0];
41+
bar.baz = array[0];
4142

4243
// With `object` enabled
4344
var foo = object.foo;
@@ -54,6 +55,8 @@ Examples of **correct** code for this rule:
5455
// With `array` enabled
5556
var [ foo ] = array;
5657
var foo = array[someIndex];
58+
[bar.baz] = array;
59+
5760

5861
// With `object` enabled
5962
var { foo } = object;

0 commit comments

Comments
 (0)