Dynamically Add Variable Name Value Pairs to JSON Object
That’s not JSON. It’s just Javascript objects, and has nothing at all to do with JSON. You can use brackets to set the properties dynamically. Example: var obj = {}; obj[‘name’] = value; obj[‘anotherName’] = anotherValue; This gives exactly the same as creating the object with an object literal like this: var obj = { … Read more