As you have found, you should not use arrays for this, you should use objects. But you have to take another step and use the object for the top level. And since your value 2015073012 will be used as a string, it is recommended to do it from the very beginning:
var results = {}; results.test = {}; results.test['2015073012'] = someObject;
or
var results = {}; results['test'] = {}; results['test']['2015073012'] = someObject;
Now you will not have problems with any JavaScript engine.
(As an aside, I changed the name from resultArr to results so that the name does not display it as an array).
JavaScript matrices are designed for cases when you have sequential entries like array[0] , array[1] , array[2] , etc. When you have arbitrary strings or arbitrarily large numbers for keys, do not use an array, use an object.
Do not confuse other languages, such as PHP, that have one type of array , which serves both as a sequential array of 0,1,2,3,... , and as a dictionary of key-value pairs. JavaScript has both arrays and objects: use arrays for the sequential case and objects for the key value case.
Back to your question why this code broke:
resultArr = []; resultArr["test"] = []; resultArr["test"][2015073012] = someObject;
One possible explanation is that the JavaScript engine does exactly what you told it when you assign the value to the index of the array [2015073012] : it creates an array with 2 015 073 013 records (one more than the value you gave, because array indices start at 0). This is over two billion entries in your array! You can probably see how this will cause a problem, and this is certainly not what you intended.
Other engines may realize that this is a ridiculously large number and treat it as a string instead of a number, as if you were using an object instead of an array in the first place. (The JavaScript array is also an object and can have key-value pairs as well as numeric indices.)
In fact, I crossed my fingers and tried this in the JavaScript console in the latest version of Chrome, and it worked without problems:
a = []; a[2015073012] = {};
But you're out of luck. In any case, you should always use objects instead of arrays for such use to ensure that they are treated as key-value pairs instead of creating huge arrays with almost empty elements.