-1

I'm migrating from AS3 to Typescript and I see that in Typescript there are no dictionaries

is there any way to create a dictionary key value with the key can be one: any?

  • What makes you think there are no Dictionaries in TS? See:https://stackoverflow.com/questions/16174182/typescript-looping-through-a-dictionary – VC.One Oct 01 '20 at 16:44

1 Answers1

2

I think you are looking for Map.

A Map's keys can be any value (including functions, objects, or any primitive), which is similar to Dictionary. I think that's what you mean by "the key can be one: any"?

Otherwise, you'd typically just use an Object if you are able to use strings for the keys.

Cadin
  • 4,275
  • 1
  • 14
  • 22