🚧 under construction -> merge
Last updated 2 years ago
Was this helpful?
⟩ ⟩ ⟩ ⟩ arguments
👉 See: object destructuring for more info.
const {log} = console; // function parameter by object destructuring function f ({ hi = 2, // default param ...options // other params as an object ⭐️ }={}) { log(options); return hi; } // test run f({x: 1, y: 2, hi: 3}); // 3 // options = { x: 1, y: 2 }
nested default values
JS.info ⟩
JavaScript: The Definitive Guide ⟩
3.10.3 Destructuring Assignment
8.3.5 Destructuring Function Arguments into Parameters
merge with destructured parameter