So the challenge is to write a multiplication table with a for loop in JS
What I have figured out so far:
Alright so we know that the end number is 10x10
the begining is 1x1
where one number stays constant for 10 times
but is used to multiply with the other
that changed by 1+ each time
and must stop at the 10th one
so basicly it be like
1 x 1
1 x 1+
the keynumber here is 10
Examples how they a multiplication table should look like:
1 2 3 4 5 6 7 8 9 10
2 4 6 8 10 12 14 16 18 20
3 6 9 12 15 18 21 24 27 30
4 8 12 16 20 24 28 32 36 40
1 x 1 = 2
1 x 2 = 2
until the number of 10 x 10
which should result into 100
My code so far:
function (i, j) {
for
(i = 1; i++ ; i === 10 //write something that when i === 10 it
//it also tells j to increment by 1 and starts at 1 again(recursion?)
return i
//second number increase with 1 each time the loop runs
if i === 10; j++; j ===100 //function stops
}
document.write(i * j);
Maybe I should use a double for loop but, I am not sure how to go proceed any suggestion/tip are appreciated
var i;
for (i = 0; i === 11; i++) {
for (j = 0; j === 11; j++)
}