我有一组数据.在一个有10个字段,在b有10个字段
var a = [ "siddharth","sid","anything","something","nothing",] var b = [ "23","67","10","90" ]
我试图从这些数组中创建一个JSON作为键和b
作为值,如下图所示:
{ "siddharth" : "23","sid" : "67" }
我如何使用javascript或jquery来实现这一点.我现在的代码是
var convert = '{'+datatest.columnHeaders[i].name +":"+datatest.rows[0][i]+'}'; pair = convert;/*JSON.stringify(convert);*/ array.pairArray.push(pair);@H_404_13@