javascript - Typescript create new map<String, List<String>> - Stack Overflow

I'm trying to create a new Map in Typescript like this:Map<String, List < String > >.

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 badges
Add a ment  | 

1 Answer 1

Reset to default 8
const categoryMap = new Map<string, string[]>();

or

const categoryMap: Map<string, string[]> = new Map();

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744257957a4565490.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信