Похожие чаты

Hi everybody The code below will check if an array is

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.

6 ответов

10 просмотров
AlY- Автор вопроса

Sorry if it's a long questions

AlY
screenshot Sorry if it's a long questions

Please read the group rules.

AlY- Автор вопроса
Sander Koenders
Please read the group rules.

this is not photo of code. its just a schema of result.

AlY- Автор вопроса

@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" ?

AlY- Автор вопроса
Kordaki.net
All of your question is making a different and new...

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:(

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта