Destructure of function parameters - Refactoring
See original GitHub issueconst calllback = event=> {
let {target} = event;
// code with used target
}
to
const calllback = ({target})=> {
// code with used target
}
Same in the opposite direction and with a more complex and deep destructure and function content.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Refactoring Your Function Parameters - Good Work
In this lesson, we take a function and refactor it to make both the function definition, and the way we call the function...
Read more >Ways to Refactor JavaScript Code You May Have Missed
The destructuring assignment syntax can decompose objects into variables, so we can use properties the same way that we use variables. To ...
Read more >Extract Functions Arguments using Destructure in JavaScript
Extract Functions Arguments using Destructure in JavaScript. ES6 Destructuring is terrific at extracting value from your arguments. So the next time you see ......
Read more >Refactoring JavaScript | WebStorm Documentation
Generate destructuring parameters for a function. Position the caret at the parameters of a function and press Alt+Enter .
Read more >JS Refactoring Combo: Introduce Object Destructuring
Destructuring is a way to access array values or object properties. It can be used in variable declarations, parameters, and catch clauses.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Shinigami92 Of course (May optionally be
const {target} = event
). Sorry for the mistake.Well, It’s good to take a try.