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
Related Code Actions
- Browser & Engine Support (Compatibility Table)
- Code Actions