0

I wrote this code and tested it. const test = [1,2] + [1,1] Output of test was

"1,21,1" ???

What does "1,21,1" stand for?

user2006734
  • 309
  • 2
  • 14
  • https://jsfiddle.net/4h98Lo5x/ – Natrium Dec 12 '19 at 09:44
  • "*What does "1,21,1" stand for?*" the result of concatenating the two arrays. It's (essentially) `[1,2].toString() + [1,1].toString()` -> `[1,2].join(",") + [1,1].join(",")` -> `"1,2" + "1,1"` -> `"1,21,1"` – VLAZ Dec 12 '19 at 10:01

0 Answers0