I refer below post but did not get it properly See here
I was tried to do this same thing as that post. The only issue is that I don’t know what the keys and the values are upfront. So I need to be able to dynamically add and remove the key and value pairs and I don’t know how to achieve that.
Is anyone know how to create that object and add key value pairs dynamically and perform crud operation on it?
I’ve tried:
var dict = [{key:"key", value:"value"}];
dict[0].key = "keys";
dict[0].value = "vals";
console.log(dict);
// return null value of dict object.
So that doesn’t work. Thank you