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

What is the output?

console.log([1, 2, 3] + [4]);
  1. 1,2,34
  2. 1,2,3,4
  3. [1,2,3,4]
  4. NaN
Both arrays stringify and concatenate: '1,2,3' + '4'.
Play Problem Solving ▸