Answered step by step
Verified Expert Solution
Link Copied!

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

));

}

image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

How Do I Use A Database Research Tools You Can Use

Authors: Laura La Bella

1st Edition

1622753763, 978-1622753765

More Books

Students also viewed these Databases questions

Question

4. Describe cultural differences that influence perception

Answered: 1 week ago