I need to add any new value to the array which is storing a response in JSON.

pict is an array in JS this.pict.push(new Error(JSON.stringify(responseholder)

let me know if i can add new string A and String B in responseholder as field.

  • just want to add method name and component name in the JSON object
    – user75850
    Nov 12 '19 at 12:54

You just need to add properties to your JSON.

responseholder.methodName = 'methodName';
responseholder.componentName = 'componentName';

So it will look like:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.