0
Can someone explain to me how the output become that?
Var myArray = []; Var i = 10 do { myArray.push(i); i++ } while (i < 5) Console.log(i,myArray); Output= 11 [10]
2 Answers
+ 1
It pushed the 10 into array so it contains only one element that is [10] and do Loop runs once before checking the condition and since i>5 only 10 is stored in array,also i got incremented after pushing 10 so i is 11
+ 1
Abhay now i got it,thx manđđ