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

What is the output?

console.log([1, 2, 3].join('-'));
  1. 1-2-3
  2. 123
  3. 1,2,3
  4. [1-2-3]
join inserts the separator between elements and returns a string.
Play Problem Solving ▸