Skip to content

Commit

Permalink
docs/rules/computed-property-spacing: adding example
Browse files Browse the repository at this point in the history
  • Loading branch information
Nishant Arora committed Jan 12, 2021
1 parent f2687e7 commit bc190dc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/rules/computed-property-spacing.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ var a = "prop";
var obj = {
[a]: "value" // computed property key in object literal (ECMAScript 6)
};

// applies to the spacing for dynamic keys (computed property key) when destructuring objects.
const ({ [a]: someProp } = obj); // someProp now maps to the value of prop.
```

## Rule Details
Expand Down

0 comments on commit bc190dc

Please sign in to comment.