最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin5浏览0评论

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();
发布评论

评论列表(0)

  1. 暂无评论