I am encountering an issue while attempting to populate a table with rows and checkboxes using the .map method. The problem arises when I try to create an array by combining two arrays obtained from the database - JournalA and JournalB.
Journal_A
[
{STUDENT_NAME: "data1",
STUDENT_SECOND_NAME: "data",
STUDENT_LAST_NAME: "data",
STUDENT_PHOTO: "data"
},
{STUDENT_NAME: "data2",
STUDENT_SECOND_NAME: "data",
STUDENT_LAST_NAME: "data",
STUDENT_PHOTO: "data"
},
{STUDENT_NAME: "data3",
STUDENT_SECOND_NAME: "data",
STUDENT_LAST_NAME: "data",
STUDENT_PHOTO: "data"
}
]
Journal_B
[{
JOURNAL_DATA: "{
"1": false,
"2": false,
"3": false
}"
}]
The desired output should be as follows
[
{STUDENT_NAME: "data1",
STUDENT_SECOND_NAME: "data",
STUDENT_LAST_NAME: "data",
STUDENT_PHOTO: "data",
BOOL:true
},
{STUDENT_NAME: "data3",
STUDENT_SECOND_NAME: "data",
STUDENT_LAST_NAME: "data",
STUDENT_PHOTO: "data",
BOOL:false
},
{STUDENT_NAME: "data2",
STUDENT_SECOND_NAME: "data",
STUDENT_LAST_NAME: "data",
STUDENT_PHOTO: "data",
BOOL:true
},
]
I have attempted to use concat() and push(), however, React does not seem to work well with them =(
let i = 0;
for (i=0; i<JournalA.length; i++){
console.log(JournalA.map[i].concat(JournalB.concat[i]));
}