var a = ["1", "2"];
var b = ["a", "b"];
var c = [];
//有人可以建议我如何将a和b推入c使得c是一个二维数组? (使用JavaScript)
// c应该看起来像[[" 1"," 2"],[" a"," b"]]
答案 0 :(得分:0)
你问的是一个非常基本的问题,答案是:
var a = ["1", "2"];
var b = ["a", "b"];
var c = []; // you could have written c = [a, b];
c.push(a, b);
答案 1 :(得分:0)
这很简单。只需使用push函数并将数组作为参数传递。
c.push(一);
c.push(b)中;
或者将它们推到一起,如:c.push(a,b);