[Improvement] Destructuring improvement
See original GitHub issueDestructured variables are not renamed and it is bad because code becomes easier to understand. I think it will be better to assign them to new variable
Example code:
const { getSecret, getSuperSecret } = require("./secret");
const secret = getSecret();
const superSecret = getSuperSecret();
console.log(secret, superSecret);
Current output:
const {getSecret,getSuperSecret}=require(r('0x2')+r('0x0')),P=getSecret(),n=getSuperSecret();console[r('0x1')](P,n);
My way to fix:
const {getSecret:v,getSuperSecret:E}=require(r('0x2')+r('0x0')),P=v(),n=E();console[r('0x1')](P,n);
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Improve your Projects with Destructuring and Modules
DRY - Don't Repeat Yourself is considered a best practice in programming. This applies while working on a single script as well as...
Read more >Destructuring Variables Performance - Stack Overflow
In conclusion destructured assignments are less computationally efficient than traditional function parameters, as of 2018 in V8. In terms of ...
Read more >How To Use Destructuring and Arrow Functions to Improve ...
Here are some every day tricks to make your JavaScript code much more readable. Destructuring. Take this (intentionally) deeply nested object. Reading the...
Read more >Object destructuring best practice in Javascript | by Crunch Tech
As we improve our knowledge, we adapt and update our destructuring ... The destructuring assignment syntax is a JavaScript expression that ...
Read more >Skipping Values In JavaScript Destructuring - Samantha Ming
Add Comments to Improve Code Readability. When using the blank space option to skip over values, you can also add comments. This will...
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
Please extract it as separate issue and add more examples and description
Merged to the
master
I’ll release a new with these changes this weekend.