+ 1

JS how to count by 10? : 10 20 30...

How do u count by 10 or other number, but for example let's count by 10. ( print 10, 20, 30, 40.....100

23rd Jul 2019, 4:37 PM
Ginfio
Ginfio - avatar
5 Respostas
+ 1
var count=0; setInterval(()=>console.log(1?count += 10:0),1000)
23rd Jul 2019, 4:47 PM
Calviղ
Calviղ - avatar
0
i'm not sure what you're asking. but if you want to put those numberas an array Array(size).join().split(',').map(function (e, i){ console.log(++i*m); return ++i* m }) //where size is the array size, and m is the multiplier
23rd Jul 2019, 4:52 PM
Taste
Taste - avatar
0
Taste you know how we print numbers 1 to 5 using for statement: var x; for (x = 0; x < 5; x++) ... output: 12345 Now i want the output to be 1020304050 (10, 20, 30....100).
23rd Jul 2019, 5:50 PM
Ginfio
Ginfio - avatar
0
like this ? for(x=0;x<100;x+=10)
23rd Jul 2019, 5:52 PM
Taste
Taste - avatar
0
Taste Yup ✔️
23rd Jul 2019, 6:27 PM
Ginfio
Ginfio - avatar