Starting with a Firebase DataSnapshot, I want something so that, in plain English, “if all the children failed the condition, execute something”.
Here is what I have now:
appleappsRef.on('value', function (allApplesSnapshot){
allApplesSnapshot.forEach(function (appleSnapshot) {
if (condition) {
//execute code
}
});
});
Per the docs, your forEach callback can return true to cancel enumeration and forEach() will return true to signal that enumeration was canceled.
This means you can do: