there in localstorage and call it . And if there isn't any array it will make an empty array and push new object element to it and save it in local storage:
var storeInLocalStorage = function(stateStore) {
var States;
if (localStorage.getItem('states') === null) {
states = [];
} else {
states = JSON.parse(localStorage.getItem('states'));
}
states.push(stateStore);
localStorage.setItem('states', JSON.stringify(states));
}
storeInLocalStorage(newState)
And newState() is an object factory like this :
Var newState= function(a,b,c){
return {Name: a,
Date: b,
Number: c }
}
And server send 100 different (a,b,c) every second. But the Name property is same every time. I mean there is 100 Name that have different date and number every second.
So there is a big array here that I need to plus the Number of an specific Name between two different time (like every 30 second)
Could you help me please? I tried everything I know.
Please read the group rules.
this is not photo of code. its just a schema of result.
@blink_bat Hey angry guy😅 could you help me please? And I am sorry of screen photo before you telling me😂just ignore the photo
All of your question is making a different and new "name" for each data? Why you don't use milli seconds of Date() as "name" ?
But how can I access the same name data by this method? For example there is John's number here that changes every second. Then how I can call this data to make some calculations? My problem is how to access this data of the same names:(
Обсуждают сегодня