15_multiply_table.js 242 B

123456789101112
  1. let multiplyTable = [];
  2. for (let i = 1; i <= 10; i++) {
  3. multiplyTable[i] = [];
  4. for (let j = 1; j <= 10; j++) {
  5. multiplyTable[i][j] = j * i;
  6. }
  7. }
  8. console.log(multiplyTable[5][6]); // 30
  9. console.log(multiplyTable[7][2]); // 14