title: break the loop in nodejs
body: <p>I have following setup code</p>
  
  <pre><code>var ele = element(by.model(xpath));
  var option = ele.isDisplayed().then(function(found) {
      ele.all(by.tagName('option')).then(function(options) {
          options.some(function(option) {
              option.getText().then(function doesOptionMatch(text) {
                  if (text == data.trim()) {
                      logger.debug("PASS--" + data.trim() + "--option selected");
                      return "PASS"; //not working
                  }
                  if (text != data.trim())
                      logger.debug("FAIL--" + data.trim() + "--option is Not selected");
              });
  
          });
      });
  }, function(err) {
      logger.debug("FAIL--Exception caught in verifyDropdownSelectedValue--" + err);
  });
  </code></pre>
  
  <p>and I want the control to be out of the loop where the return statement is written but it is not working and continuing the iteration. Here is the looping part that is not exiting when I return a truthy value</p>
  
  <pre><code> options.some(function(option) {
       option.getText().then(function doesOptionMatch(text) {
           if (text == data.trim()) {
               logger.debug("PASS--" + data.trim() + "--option selected");
               return "PASS"; //not working
           }
           if (text != data.trim())
               logger.debug("FAIL--" + data.trim() + "--option is Not selected");
       });
   });
  </code></pre>