Is it possible to make something like this:
var fieldObjArray = Array();;
for(var k in SpesificPropertiesInfo){
var fieldTable = createFieldTable(SpesificPropertiesInfo[k]);
fieldObjArray[SpesificPropertiesInfo[k].fieldName]['fieldStatus'] = SpesificPropertiesInfo[k].fieldStatus;
fieldObjArray[SpesificPropertiesInfo[k].fieldName]['fieldName'] = SpesificPropertiesInfo[k].fieldName;
fieldObjArray[SpesificPropertiesInfo[k].fieldName]['columnName'] = SpesificPropertiesInfo[k].columnName;
}
I want to create an array that it first dimensions is an associative one (and dynamic // i do not know its name at the beginning), the second dimensions is an associative but i do know it’s name.
Yes. It is.
However, use objects, not arrays.
Arrays in JS are only for
0...nindices, and don’t work properly withfor ... in, either.You now have a
myObjwhich has all ofyourObj‘s primary indices, each one an object, containing the properties of the second dimension…