vendredi 8 mai 2015

Self-terminate an if statement?

How can I achieve the following?

Inside map function loop. Terminate an if statement after it has been 'true' once.

array.prototype.map(function (data){
   if (true) {
      // Do something
      // Self destroy so I won't be available for next iteration
   }
});

Aucun commentaire:

Enregistrer un commentaire