我正尝试在 Typescript 中创建一个新 map ,如下所示: map >。 类似的东西(这个例子是在 java 中):
private map<String, List<String>> map = HashMap<String, ArrayList<String>();
到目前为止我的代码是:
myMap=new Map();
我尝试了不同的方法,但都不起作用。如何实现?
最佳答案
const categoryMap = new Map<string, string[]>();
或
const categoryMap: Map<string, string[]> = new Map();
关于javascript - typescript 创建新 map <String, List<String>>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69177660/