What does this program print?

from Type guards
TypeScript 6 beginner 2 min

What does this program print?

TypeScript
function describe(value: string | number | undefined): string {
  if (!value) return "empty";
  return typeof value === "string"
    ? value.toUpperCase()
    : value.toFixed(0);
}

console.log(describe(0));
console.log(describe(""));
console.log(describe(3.6));
Open in playground
Report an error