Skip to content

Instantly share code, notes, and snippets.

@marcelmokos
Created October 16, 2019 20:55
Show Gist options
  • Save marcelmokos/9364f27517f4f6991b929e6cfa2d2252 to your computer and use it in GitHub Desktop.
Save marcelmokos/9364f27517f4f6991b929e6cfa2d2252 to your computer and use it in GitHub Desktop.
typed object argument function
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