我有以下从 Entity Framework 5 返回的 javascript 对象从 SQL Server 数据库获取。
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}]
}
我想添加一个空的答案对象,然后使用 PUT 发送回服务器。
如何将答案对象添加到变量 a 和变量 b ?