$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · medium · #151

What is the output?

const xs: number[] = [1, 2];
console.log(xs.length + '!');
  1. 2!
  2. !2
  3. 12!
  4. NaN!
Types vanish at runtime; number + string concatenates to "2!".
Play Problem Solving ▸