DEV Community

Discussion on: JavaScript Interview Question #33: Add two empty arrays and check the type

Collapse
 
polaroidkidd profile image
Daniel Einars • Edited

Wait, there are languages where using the + operation concatenates the arrays?

Collapse
 
coderslang profile image
Coderslang: Become a Software Engineer

Python

Collapse
 
pliavi profile image
Vitor "Pliavi" Silvério

Python :v
And you can do this in Elixir too, but with ++

Collapse
 
coderslang profile image
Coderslang: Become a Software Engineer

And in some languages, you can overload the + operator and write your own implementation of it that will behave differently for arrays/objects/etc.