Ruby has the << concatenation operator. It can be used to push an item to an array (.push() can also be used in Ruby, but it is longer). It is used like this:
array = [1, 2]
array << 3
return array # Will return [1, 2, 3]
Is there a similar Javascript operator to do that, or do I have to use .push()?
Solved: There is no Javascript operator similar to <<. You have to use push (Or create a function with a short name like a and push the only argument it takes)
<<. Thanks for the link anyway!