A
A
ArtemEfremov2020-04-20 00:07:36
Node.js
ArtemEfremov, 2020-04-20 00:07:36

How to iterate over values ​​under another condition until the condition becomes necessary?

There is a code.

var random = // функция случайного числа от 1 до 10 //

 If(base[random].time !== 5) {
// base - массив с объектами
}


How to do this: if the time property is not equal to the number 5, then iterate through the arrays in order to get an array with a property that is equal to 5. (Sort of a loop until the property is 5)

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