A
A
Arioxe2022-03-11 19:56:44
Node.js
Arioxe, 2022-03-11 19:56:44

How to assign data received via websocket to an array?

I get lines like this

[2022-03-11 16:48:10.751|]}]}
[|2022-03-11 16:48:10.721]}]}
[2022-03-11 16:46:47.660]}]}   
[2022-03-11 16:48:10.700]}]}

While the connection is active, I get these lines. I need only these 4, how can I make a filter so that when receiving strings, it compares these identifiers - "401203106, 401203109, etc."? That is, if they are in a string, then you need to assign it to an array.
In fact, I receive messages from the server and they go separately. I understand that I need to stop the connection as soon as the necessary lines are in the array, I understand how to do this, but I just can’t figure out how to assign these lines to the array

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question