In this JavaScript lesson on Codecademy it is required to write a do/while loop, I have written this, and it passes
var getToDaChoppa = function(b){
var a = b;
do{
console.log("Dunno!");
} while (a < b);
};
getToDaChoppa(25);
But when looking closely at my code, I think that I may have done it completely wrong since a has no defined value?
Or since the variable of b is local inside the function, it does not affect the b argument which is passed a value of 25?
Many thanks in advance.
a = band neither is modified later,a < bwill always be false. The body of your loop will only run once.