TypeScript, Looping through a dictionary

后端 未结 8 844
慢半拍i
慢半拍i 2020-12-04 11:41

In my code, I have a couple of dictionaries (as suggested here) which is String indexed. Due to this being a bit of an improvised type, I was wondering if there any suggesti

8条回答
  •  悲&欢浪女
    2020-12-04 12:03

    Shortest way to get all dictionary/object values:

    Object.keys(dict).map(k => dict[k]);
    

提交回复
热议问题