lundi 2 janvier 2017

Why does while loop run one time more?

As for the question, code inside loop gets called once more after its condition becomes false. I noticed it running a debug.

var bPrc=(Math.random()*120.0).toFixed(4);
                var aPrc=0;
                while (aPrc<bPrc){
                    aPrc=(Math.random()*120.0).toFixed(4);
                }




Aucun commentaire:

Enregistrer un commentaire