Strings In Depth11 / 18
Up next

Typed helper

// a typed helper uppercases the first letter
function capitalize(word: string): string {
  if (word.length === 0) return word;
  return word[0].toUpperCase() + word.slice(1);
}

console.log(capitalize("hello"));
What you're solving

string manipulation in a typed function