-
-
Save elrrrrrrr/55677d3be92e39958cec to your computer and use it in GitHub Desktop.
JS es6 default param
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
function complex({ name, email, phone = null }) { | |
//variables `name`, `email`, and `phone` are available here | |
} | |
var user = { | |
name: 'foo', | |
email: 'bar', | |
phone: '123456' | |
}; | |
complex(user); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment