mardi 25 septembre 2018

How can I effectively use If-else (or any other approach) inside for loop without degrading performance

How can I effectively use if-else inside the for loop without degrading the performance of the code or there is any other approach which can be used further to achieve the same result.

for (var i = 0; i < parameters.length; i++) {

    if(Some Condition)
    ---
    else
    ---

}

if(Some Condition) classifyError();

This is just the code structure I have right now, a new approach is really appreciated.

Thank you,

Aucun commentaire:

Enregistrer un commentaire