I have the following javascript object that came back from an Entity Framework 5 get from a SQL Server database.
var a =
{
"questionId":14,
"questionStatusId":1,
"answers":null
}
var b =
{
"questionId":15,
"questionStatusId":1,
"answers":[
{"answerId":34,"correct":true,"response":false,"text":"5","image":null,"questionId":15},
{"answerId":35,"correct":false,"response":false,"text":"50","image":null,"questionId":15}]
}
I would like to add an empty answer object and then send back to the server with a PUT.
How can I add an answer object to variable a and to variable b ?
a.answers = [{}],b.answers.push({})?