Hello who can help me with this? I have a json and I parse it, after that for each item i need to create an array
This is my json:
0: Object
title: "title0"
content: "content0"
comment: "comment0"
1: Object
title: "title1"
content: "content1"
comment: "comment1"
I have a function
var mystockinfo = [];
function uploadSomething(data){
var myjsonparse = JSON.parse(data.div);
for (var i = 0; i < myjsonparse.length;){
mystockinfo[i][0] = myjsonparse[i].title;
mystockinfo[i][1] = myjsonparse[i].content;
mystockinfo[i][2] = myjsonparse[i].comment;
i++;
}
}
console.log(mystockinfo);
I need to have
[ 0 => [title0, content0, comment0], 1 => [title1, content1, comment1]]
Can you please help me with this???