Created
March 5, 2021 22:15
-
-
Save NyaGarcia/98be8c3e761657b11c17e70ae9b84ce6 to your computer and use it in GitHub Desktop.
Destructuring arguments in arrow function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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