What does this program print?

from Union and intersection types
TypeScript 6 beginner 3 min

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 "));
Open in playground
Report an error