Answer the question
In order to leave comments, you need to log in
What will be faster using if or forEach?
Through the ws connection, 20-50 JSON requests (data) are received per second, each of which needs to be parsed, and after that either put a condition (if), whether it fits or not, or create an array and sort through all the received data through foreach, which will be faster ? Or maybe there is an even faster way?
Answer the question
In order to leave comments, you need to log in
The answer is here:
Or create an array and use foreach to sort through all the incoming data, which will be faster?
Look in the direction of rxjs, you will find a lot of useful things for yourself. I advise you to use streams for this task.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question