I'm trying to create a new Map in Typescript like this: Map<String, List < String > >. Something like (this example is in java):
private map<String, List<String>> map = HashMap<String, ArrayList<String>();
Until now my code is:
myMap=new Map();
I tried different approaches but it doesn't work. How it can be done?
I'm trying to create a new Map in Typescript like this: Map<String, List < String > >. Something like (this example is in java):
private map<String, List<String>> map = HashMap<String, ArrayList<String>();
Until now my code is:
myMap=new Map();
I tried different approaches but it doesn't work. How it can be done?
Share Improve this question edited Sep 14, 2021 at 12:27 denisiulian asked Sep 14, 2021 at 12:18 denisiuliandenisiulian 2738 silver badges20 bronze badges1 Answer
Reset to default 8const categoryMap = new Map<string, string[]>();
or
const categoryMap: Map<string, string[]> = new Map();
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744257957a4565490.html
评论列表(0条)