2

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?

1 Answer 1

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

or

const categoryMap: Map<string, string[]> = new Map();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.