Skip to content

Instantly share code, notes, and snippets.

@NyaGarcia
Created March 5, 2021 22:15
Show Gist options
  • Save NyaGarcia/98be8c3e761657b11c17e70ae9b84ce6 to your computer and use it in GitHub Desktop.
Save NyaGarcia/98be8c3e761657b11c17e70ae9b84ce6 to your computer and use it in GitHub Desktop.
Destructuring arguments in arrow function
const logUser = ({ name, pass }) =>
`Logging user ${name} with password: ${pass}`;
const user = { name: "Nya", pass: "secretpassw0rd" };
console.log(logUser(user));
// Output: Logging user Nya with password: secretpassw0rd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment