Javascript Arithmetic Operator Question 3

Introduction

We would like to write code that displays the results of the 12 times table

Using console.log(), write code that displays the results of the 12 times table.

Its output should be the results of the calculations.

12 * 1 = 12 
12 * 2 = 24 
12 * 3 = 36 
...
12 * 11 = 132 
12 * 12 = 144 



let timesTable = 12; 

for (let timesBy = 1; timesBy < 13; timesBy++) { 
    console.log(timesTable + " * " + 
                   timesBy + " = " + 
                   timesBy * timesTable + "<br />"); 
} 



PreviousNext

Related