Answers for "nullable parameter typescript"

0

nullable parameter typescript

const sayHello = (name: string, age?: Number): string => {
	if(age) return `Hello ${name}! You are ${age} years old.`;
	else return `Hello ${name}! How old are you?`;
}
Posted by: Guest on March-04-2022

Code answers related to "TypeScript"

Browse Popular Code Answers by Language