mercredi 14 octobre 2015

Does Ember have a some() method like Dojo

Does Ember have a some() method like Dojo

I am trying to run the below code;

obj.view = someObj.forEach(function(tempArr){
    return (tempArr.actionName == "view") ? true : false ;
});

But since forEach does not terminate, the code does not work properly.

I want to exit at the first find (return true) So I want something similar to what DojoJS has dojo.some() http://ift.tt/1ZCLdtT

In simple terms, I want to break and return true for the variable on first condition that is true (else return false for the variable)




Aucun commentaire:

Enregistrer un commentaire