nullable parameter typescript

The solution for “nullable parameter typescript” can be found here. The following code will assist you in solving the problem.

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?`;
}

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in