-In JavaScript you can use a generic value type var
-In Java you must use explicit value types double, int, String etc
-In JavaScript the Array can have also heterogeneous values.
-In Java an array can have only values of the same kind,(for example all double or all String).
What happen if I write in JavaScript?
var test[]=new Array();
test[1] = 16.98;
test[2] = 8.33;
test[3] = 5.31;
test[10] = 5.04;
The NOT-ASSIGNED index values are set to 0, to null, or to blankspace?
Since all primitive values have a specific null value, for boolean false, for int 0 etc. If I want to port the above array form JavaScript to Java without errors I should know exactly the JavaScript policy for not assigned index values of the array.
Is correct to port the above sample in Java in this way?
double test[]={0, 16.98, 8.33, 5.31, 0, 0, 0, 0, 0, 0, 5.04}