How to create dictionary and add key–value pairs dynamically?

后端 未结 15 775
没有蜡笔的小新
没有蜡笔的小新 2020-11-28 00:37

From post:

Sending a JSON array to be received as a Dictionary

I’m trying to do this same thing as that post. The only issue is that I d

15条回答
  •  广开言路
    2020-11-28 01:26

    You can use maps with Map, like this:

    var sayings = new Map();
    sayings.set('dog', 'woof');
    sayings.set('cat', 'meow');
    

提交回复
热议问题