🚧 under construction
Last updated 2 years ago
Was this helpful?
⟩ ⟩ ⟩ ⟩ rest parameters as object
🚧
💾 程式:
const { log } = console; function f({ // parameter destructuring hi = 0, // default parameter ...opts // rest params as an object ⭐️ } = {}) // default parameter { log(hi); log(opts); } // test run f(); // 0, {} f({ x: 1, y: 2, hi: 3 }); // 3, { x: 1, y: 2 }
destructuring assignment
rest operator (...)