Created
June 30, 2025 18:19
-
-
Save benhatsor/23d56278f8a5f2462db166fabf06ee0f to your computer and use it in GitHub Desktop.
Object destructuring with defined variables.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let a, b; | |
const obj = { a: 1, b: 2 }; | |
({ a, b } = obj); | |
console.log(a, b); // 1 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment