I wanted to add the elements of an array into another, so I tried this:
[1,2] + [3,4]
It responded with:
"1,23,4"
What is going on?
I wanted to add the elements of an array into another, so I tried this:
[1,2] + [3,4]
It responded with:
"1,23,4"
What is going on?
It is because, + operator assumes that the operands are string, if they are not numbers. So, it first converts them to string and concats to give the final result , if its not a number. Also, it does not support arrays.