In order to achieve my goal, I am looking to create a JSON array structure similar to the one shown below:
var args = [{ name: 'test', value: 1 }, { key: 'test2', value: 2}];
How can I modify the code snippet provided below to generate an array in the format mentioned above?
this.dependentProperties = []; // Initializing an empty array
function addDependentProperty(depName, depValue) {
dependentProperties.push(new Array(depName, depValue));
}
Currently, when using the push method as described, the resulting JSON notation looks like this:
args:{[["test1",1],["test2",2]]}