108
rated 0 times
[
114]
[
6]
/ answers: 1 / hits: 35073
/ 7 Years ago, wed, february 15, 2017, 12:00:00
How to get the loop values outside the loop below example only prints the last value, For example if i wanted to print the loop results.
var result;
for (var i=0; i < 10; i++) {
result = i;
}
console.log(result);
Now how can i get the iterated values of the loop which are (1 to 10) in the console, because now i will only print the last value which is 10.
More From » loops