This is in case you want to define properties of an object using existing variables.
let name = ‘Amy’;
let age = 28;
let person = { name, age }; // { name: ‘Amy’, age: 28 }
Note that the property’s name is the same as the existing variable’s name.
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter