九九乘法表

原创 Luna325 随笔 js 157阅读 2017-12-21 17:32:48 举报

var table = new Array(10)
for(var i =0;i<table.length;i++) {
table[i] = new Array(10);
for(var j=0;j<table.length;j++) {
table[i][j] = i*j
}
}
console.log(table)

(10) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n
(10) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n
(10) [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]\n
(10) [0, 3, 6, 9, 12, 15, 18, 21, 24, 27]\n
(10) [0, 4, 8, 12, 16, 20, 24, 28, 32, 36]\n
(10) [0, 5, 10, 15, 20, 25, 30, 35, 40, 45]\n
(10) [0, 6, 12, 18, 24, 30, 36, 42, 48, 54]\n
(10) [0, 7, 14, 21, 28, 35, 42, 49, 56, 63]\n
(10) [0, 8, 16, 24, 32, 40, 48, 56, 64, 72]\n
(10) [0, 9, 18, 27, 36, 45, 54, 63, 72, 81]\n

评论 ( 0 )
最新评论
暂无评论

赶紧努力消灭 0 回复