Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/59.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Typescript 多字符串数组的数组_Typescript - Fatal编程技术网

Typescript 多字符串数组的数组

Typescript 多字符串数组的数组,typescript,Typescript,我试图创建一个字符串数组,如下所示: let rules : type = [ ["N"] ["N", "N"] ["N", "N", "N"] ] 但我无法设定类型。我如何才能做到这一点?这里有几个选项。最好的方法是使用真正的数组: let rules : string[][] = [ ["N"], ["N", "N"], ["N", "N", "N"] ]; 或 或 或 这里有几个选项。最好的方法是使用真正的数组: let rules : string[][] = [ ["

我试图创建一个字符串数组,如下所示:

let rules : type = [
 ["N"]
 ["N", "N"]
 ["N", "N", "N"]
]

但我无法设定类型。我如何才能做到这一点?

这里有几个选项。最好的方法是使用真正的数组:

let rules : string[][] = [
 ["N"],
 ["N", "N"],
 ["N", "N", "N"]
];


这里有几个选项。最好的方法是使用真正的数组:

let rules : string[][] = [
 ["N"],
 ["N", "N"],
 ["N", "N", "N"]
];

或者阵列或阵列。或数组[]。或[数组]。或者……:)或者阵列或阵列。或数组[]。或[数组]。或者……:)
let rules : [string[]] = [
 ["N"],
 ["N", "N"],
 ["N", "N", "N"]
];
let rules : [string][] = [
 ["N"],
 ["N", "N"],
 ["N", "N", "N"]
];
let rules : [[string]] = [
 ["N"],
 ["N", "N"],
 ["N", "N", "N"]
];