How i can to stop .forEach cycle? Break don't work :(

I have json object in Observable var., and use .forEach. But i don’t need so long cycle, i tried to use break, but log said that it don’t work :frowning: Is there some items for this trouble?


You cannot break out of a .forEach in javascript (ref:

Try using a normal for loop, for example:

var obs = Observable(...);

for (var i = 0; i < obs.length; i++) {
	var item = obs.getAt(i);
	if (your_test(item))