📜  继续 foreach javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:08.483000             🧑  作者: Mango

代码示例1
elementsCollection.forEach(function(element){
  if (!element.shouldBeProcessed)
    return; // stop processing this iteration

  // This part will be avoided if not neccessary
  doSomeLengthyOperation();
});