Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-4826

Break forEach loop

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Won't Fix
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • JavaScript
    • None

    Description

      Ability to stop iterating on a forEach by returning false, similar to jQuery: http://api.jquery.com/jQuery.each/

      The following code would print only 1 & 2.

      [1,2,3,4].forEach(function(v) { print(v); if (v >= 3)

      {return false; }

      })

      Attachments

        Activity

          People

            Unassigned Unassigned
            kmorales Kirk Morales
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: