I\'m building an app using meteor.js and MongoDB and I have a question about cursor.forEach(). I want to check some conditions in the beginning of each forEach iteration and
Making use of JavaScripts short-circuit evaluation. If el.shouldBeProcessed returns true, doSomeLengthyOperation
el.shouldBeProcessed
doSomeLengthyOperation
elementsCollection.forEach( el => el.shouldBeProcessed && doSomeLengthyOperation() );