简体   繁体   中英

Destructuring assignment in React or nodejs

What are the drawbacks of using destructuring assignment in JavaScript? Anything to keep in mind while using in react or nodejs?

There are not really any drawbacks that don't exist for other convenience features.

The primary thing to keep in mind is not to forget the let, var, const keyword. Otherwise all destructured may become global.

let { a,b,c } = myObj;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM