mercredi 28 mars 2018

Javascript programmer FOR loop with IF logic for career - Challenge

Javascript programmer FOR loop with IF logic for career - Challenge :

How can we make this FOR loop Logic for a young JS programmer Better ??

for(var salary=0; salary<=ideal.minSalReq; salary++){

  if(postionOffrd[salary]<basicSalReq)
  {
    continue;
  }
  else if(postionOffrd[salary]===basicSalReq)
  {
     ideal.salNegotiate(postionOffrd[salary]);
  }



if(postionOffrd.indexOf(postionOffrd[salary])=== postionOffrd.length-1)
 {
   ideal.acceptServitude( postionOffrd[salary] );
   break;
 }


} /*end of for-loop*/

Aucun commentaire:

Enregistrer un commentaire