Created
October 16, 2019 20:55
-
-
Save marcelmokos/9364f27517f4f6991b929e6cfa2d2252 to your computer and use it in GitHub Desktop.
typed object argument function
This file contains 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 fullName = ( | |
{firstName = "", lastName = ""} // we are providing default values | |
: {firstName: string, lastName: string} // type, can be inferenced | |
= {} // default value object for object argument | |
) => `${firstName} ${lastName}`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment