Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript destructure object and rename

const o = {p: 42, q: true};
const {p: foo, q: bar} = o;

console.log(foo); // 42
console.log(bar); // true
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #javascript #destructure #object #rename
ADD COMMENT
Topic
Name
3+1 =