Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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