Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
));
}
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started