> ## Content Index
> Fetch the complete content index at: https://blog.hacking.pub/llms.txt
> Use this file to discover other available public pages before exploring further.

# 九九乘法表 js版
- URL: https://blog.hacking.pub/2017/03/13/jiu-jiu-cheng-fa-biao-jsban/
- Published: 2017-03-13T12:20:24.000Z
- Updated: 2017-03-13T12:20:43.000Z
- Author: chainhelen
- Tags: js, javascript, nodejs, 九九乘法表

随便写写

```
for(let i = 1;i <= 9;i++) {
  let m = "";
  for(let j = 1;j <= i;j++) {
    m += `${j}*${i}=${i * j} `
  }
  console.log(m)
}

```

不过在知乎上看到另一种写法

```
console.log([...Array(9)].reduce( (m, _, x) => m + [...Array(x + 1)].reduce( (m, _, y) => m += `${y + 1}*${x + 1}=${(x + 1) * (y + 1)} `, "") + "\n", ""));

```