I have been learning some javascript recently and found out that you can store different data types in an array like this:
var myArray = [12, 23.5, "hello", true];
I have some Java background and this is not possible in Java as you would have to declare the data type otherwise you would get an error (int myArray = blah blah blah)
So my question is, in what situations would you use this instead of an object for example. Examples would be great. Thanks.
arguments, as given to.apply().ArrayList<Object>in Java.