Question: i am getting this error in one of my code of Javascript, Css, and Html code assignment. This is my code: function loadArrays(dataJSON){ var studentList

i am getting this error in one of my code of Javascript, Css, and Html code assignment.
This is my code:

function loadArrays(dataJSON){

var studentList = dataJSON.student;

for(let student of studentList){

console.log(student);

sArray.push(new Student(

student.name,

student.studentId,

student.login,

student.program,

student.homeCountry,

student.profileImage

));

}

 i am getting this error in one of my code of
uncaught (in promise) TypeError: studentList is not iterable at loadArrays(code above^) at (code below) --> loadArrays(dataJSON); shown as an error

function loadData() {

console.log("in function");

fetch("data/a1.json")

.then((res) => res.json())

.then((dataJSON) => {

console.log(dataJSON);

loadArrays(dataJSON);

loadView(sArray, true);

});

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!