Answers for "jsdoc object destructuring"

0

jsdoc object destructuring

/**
 * My cool function.
 *
 * @param {Object} obj - An object.
 * @param {string} obj.prop1 - Property 1.
 * @param {string} obj.prop2 - Property 2.
 */
const fn = function ({prop1, prop2}) {
  // Do something with prop1 and prop2
}
Posted by: Guest on August-24-2021
0

object destructuring example

const hero = {
  name: 'Batman',
  realName: 'Bruce Wayne',
  address: {
    city: 'Gotham'
  }
};

// Object destructuring:
const { realName, address: { city } } = hero;
city; // => 'Gotham'
Posted by: Guest on February-18-2021
0

destructure to object

({x: oof.x, y: oof.y} = foo);
Posted by: Guest on September-09-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language