I have an array in JavaScript that I receive from the back end and has the following structure:
scope.myArray = [{"0":[1,2,3,4],"1":[0,2,3,1,4]},{"0":[1,2,3,4],"1":[0,2,3,1,4]}]
I tried to retrieve some of the values by doing this:
for(var x=0;x<scope.myArray.length;x++){
console.log("myArray is ....... " + JSON.stringify(scope.myArray[x].0))
}
and this
for(var x=0;x<scope.myArray.length;x++){
console.log("myArray is ....... " + JSON.stringify(scope.myArray[x]."0"))
}
but neither works.
Any help with this would be greatly appreciated. Thanks in advance.
JSON.stringify(scope.myArray[x]["0"]))or just[0]