$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · easy · #132

What is the output?

console.log([1, 2] + [3]);
  1. 1,23
  2. [1,2,3]
  3. 1,2,3
  4. NaN
+ converts both arrays to strings, so "1,2" and "3" are concatenated.
Play Problem Solving ▸