Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

continue foreach javascript

elementsCollection.forEach(function(element){
  if (!element.shouldBeProcessed)
    return; // stop processing this iteration

  // This part will be avoided if not neccessary
  doSomeLengthyOperation();
});
 
PREVIOUS NEXT
Tagged: #continue #foreach #javascript
ADD COMMENT
Topic
Name
4+6 =