Language syntax
Object destructuring
Reads properties by key, including inherited properties. The colon chooses a local binding name. A nullish source throws TypeError; an undefined property triggers the default.
Formal Syntax & Structure
javascript syntaxjavascript
const { key: local = fallback } = source;Working Example
Example Snippetjavascript
const {price:p=9}={price:4}; console.log(p);