The backend gave me a strange websocket to work with where the array data of [2,4,5,1,3,5,...]
has been processed as {'00:00':{...'count':2...}...}
...
So first I need to count the length of an object, and when I use object.length, it returns undefined
...
And then I need to recreate an array by using:
var newArray = [];
for(var i = 0; i < object.length; i++){
newArray.push(object[i].count);
}
My question is how to find the length of an array with names and keys and select them with index?
It looks like I have to first get an array from an object with Object.keys
or Object.values
and then work from there.