I'm struggling to understand how should objects be accessed if they are at the same position in an array?
For example: An array that consists of 3 arrays. Each of those 3 arrays hold 48 objects that are identical. I only need 1 object from each of those arrays. Array[0]
gets me those 3 objects but they are at the same position thus when i'm loading the array[0]
into datasets for a chart it doesn't show them at the same time, but updating over each other.
I'd appreciate any help. Thanks!
console.log(graphDatasetsArray[0])
output :
Object { label: "obj1", data: (48) […], fill: false, borderColor: "#ff0000", backgroundColor: "#ff0000", pointBackgroundColor: "#ff0000" }
Object { label: "obj2", data: (48) […], fill: false, borderColor: "#ff0000", backgroundColor: "#ff0000", pointBackgroundColor: "#ff0000" }
Object { label: "obj3", data: (48) […], fill: false, borderColor: "#ff0000", backgroundColor: "#ff0000", pointBackgroundColor: "#ff0000" }
How could I put these 3 objects into a new array, so that I can access them by [0],[1],[3] etc. ?