1/**
2 * My cool function.
3 *
4 * @param {Object} obj - An object.
5 * @param {string} obj.prop1 - Property 1.
6 * @param {string} obj.prop2 - Property 2.
7 */
8const fn = function ({prop1, prop2}) {
9 // Do something with prop1 and prop2
10}
11
1const hero = {
2 name: 'Batman',
3 realName: 'Bruce Wayne',
4 address: {
5 city: 'Gotham'
6 }
7};
8
9// Object destructuring:
10const { realName, address: { city } } = hero;
11city; // => 'Gotham'