我必须声明一些变量,并希望缩小代码。这是我当前的代码:
let a = [0,0,0,0,0,0,0,0,0,0];
let b = [0,0,0,0,0,0,0,0,0,0];
let c = [0,0,0,0,0,0,0,0,0,0];
有没有办法减少代码?
我尝试了以下操作,但不起作用:
let a = b = c = [0,0,0,0,0,0,0,0,0,0];
或
let a, b, c = [0,0,0,0,0,0,0,0,0,0];
或
let a = [0,0,0,0,0,0,0,0,0,0];
let b = a; // b becomes a pointer to "a"
let c = a;