What does this program print?
TypeScript
function display(value: string | number): string {
return typeof value === "number"
? value.toFixed(1)
: value.trim().toUpperCase();
}
console.log(display(2));
console.log(display(" ready "));
function display(value: string | number): string {
return typeof value === "number"
? value.toFixed(1)
: value.trim().toUpperCase();
}
console.log(display(2));
console.log(display(" ready "));