eg1(数组中包含的是数组): var jsonData = {}; var arr = [[1, 'boy', 'dabing'], [2, 'girl', 'dabing']]; for (var i = 0; i < arr.length; i++) { var key = arr[i][1]; var value = arr[i][2]; jsonData[key] = value; } console.log(jsonData['boy'])// 'dabing' eg2(数组中包含的
有一个JS数组,如: var arr = [["projectname1","projectnumber1"],["projectname2","projectnumber2"],["projectname3","projectnumber3"]]; 想将此数组转换成JSON字符串,如: var jsonarr = [{"projectname":projectnam