Skip to content

Instantly share code, notes, and snippets.

@mchelen
Created February 12, 2020 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mchelen/35d2c3b03cdc43c50b3c51e89679234c to your computer and use it in GitHub Desktop.
Save mchelen/35d2c3b03cdc43c50b3c51e89679234c to your computer and use it in GitHub Desktop.
ES6 Destructured Object Parameters
greet({
greeting: 'Hello',
firstName: 'Jane',
lastName: 'Smith',
title: 'Dr.',
});
function greet({
greeting,
firstName,
lastName,
title,
}) {
console.log(`${greeting}, ${title} ${firstName} ${lastName}`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment