Answers for "typescript define variable with default value"

3

typescript default parameter

function sayName({ first, last = 'Smith' }: {first: string; last?: string }): void {
  const name = first + ' ' + last;
  console.log(name);
}

sayName({ first: 'Bob' });
Posted by: Guest on August-27-2020

Code answers related to "typescript define variable with default value"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language