I am struggling with deserializing JSON data into multiple instances of an object I have defined. Here is how the object is structured:
function Question_Value__c () {
this.Id=null;
this.Name=null;
this.Question__c=null;
this.Order__c=null;
}
The JSON data I am trying to deserialize looks like this:
[{"id":"a0Dd000000RTVsAEAX","name":"ee"},{"id":"a0Dd000000RTVsAEAX","name":"ee"},{"id":"a0Dd000000RTVsAEAX","name":"ee"},{"id":"a0Dd000000RTVsAEAX","name":"ee"},{"id":"a0Dd000000RTVsAEAX","name":"ee"}]
This is what I've tried so far:
allValues = new Array(new Question_Value__c());
$(returnedJSON).each(function() {
allValues.push($(this));
console.log(allValues[0].id);
});
Any guidance on how to properly deserialize and work with JSON in JavaScript would be greatly appreciated, as I am still relatively new to this area.