Push operator into assignment
Move an operator from a binary expression into an assignment operator, e.g.,
Why is this refactoring helpful?
Moving an operator into the assignment is a more concise notation that emphasizes that a variable is modified with an update relative to its current value.
What do I need to consider?
Logical Assignment Operators (
??=) are an ES2021 feature. They are supported on all modern browsers and on Node 15+, and but for older browsers and Node versions transpilation might be required
- Code Assist ID (for the configuration file):
- You can configure custom keyboard shortcuts with this code action kind:
- This code assist provides refactoring suggestions. Learn how to configure the refactoring suggestion visibility.
Related Code Assists
- Browser & Engine Support (Compatibility Table)
- P42 Code Assists