dataPoints: [
for(i = 0;i<json.data.length;i++){
{ label: json.data[i][1], y: parseInt(json.data[i][2])}
}]
나는 그런 코드가 있지만 consoole에 대한 오류는 SyntaxError: missing 'of' after for
아무도 이유를 알고 있습니까? 인터넷 검색을했지만 이유를 알 수 없습니다.
분명히 잘못된 구문이 표시됩니다. 배열을 만들고 싶으므로 사용하십시오.Array.map()
dataPoints: json.data.map(function (d) {
return {
label: d[1],
y: parseInt(d[2])
}
})
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다