I was just playing around with JavaScript and got stuck with a simple program.
I declared an array in JavaScript like
var a = [0, 1, 2];
JavaScript isn't a strongly typed language.
In Java you declared an array of integers. The default value of any element in that array is 0.
In JavaScript, when you declare an array, the default value is undefined as it can hold anything, number, string, any object (including another array). All elements of a JavaScript array don't have to be the same type.