0

I hava a dictionary defined like this:

dicti: { [index: string]:  string }

Is there a way to find the value of a key by its content? (the content is unique on each key)

Alexvdan
  • 141
  • 2
  • 10
  • 1
    `Object.keys(dicti).find(k => dicti[k]===val)`? – jcalz Jul 15 '19 at 15:42
  • 1
    The question is tagged "typescript" but there's nothing specific to the type system or downlevel emitting here ... and therefore the answer will be the same as for JavaScript. Closing as duplicate – jcalz Jul 15 '19 at 15:46

0 Answers0