JS ⟩ operator ⟩ assignment ⟩ destructuring ⟩ nested
💾 程式:replit
let opts = { size : {width: 100, height: 200}, // object in object items: ["Cake", "Donut"], // array in object extra: true }; // ⭐ nested destructuring let { size : {width, height}, items: [a, b], title = "Menu" // default value } = opts; // width=100, height=200, a="Cake", b="Donut", title="Menu"
JS.info ⟩ nested destructuring
Ronald Chen ⟩ Destructuring Nested Objects
Jay Cruz ⟩ How to Destructure Nested JavaScript Objects
destructuring array
object destructuring
app.makeTable()
ES6 deep nested object destructuring
Last updated 2 years ago