Code QuizAdvanced

typeof String With Wrong Casing

A typeof narrowing check uses the wrong string literal and never matches.

Codetypescript
function format(value: string | number): string {
  if (typeof value === "String") {
    return value.trim();
  }
  return " ".repeat(value);
}

Why does this fail to narrow `value` to `string`?