Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please explain nested for loops in Javascript like I'm 5 years old. No matter how many examples I look at of nested for loops, I

Please explain nested for loops in Javascript like I'm 5 years old. No matter how many examples I look at of nested for loops, I can't really understand what they're doing, or when I'd actually want to use them. Every time I look at an example of someone using them, I figure I can just call on the items in a single loop. I can't find many concrete examples where I'd say ''ahh, I definitely need to nest for loops for this''. I did this project recently, and I still can't conceptualize what the loop is actually doing:

axios.get("https://lambda-times-backend.herokuapp.com/articles").then(response => {

console.log(response);

const cardsContainer = document.querySelector('.cards-container');

const arrayFromResponse = Object.values(response.data.articles);

arrayFromResponse.forEach((item) => {

item.forEach((article) => {

cardsContainer.appendChild(articleCreator(article));

})

})

}).catch(error => {

console.log("the data was not returned", error)

});

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

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions

Question

LO1 Summarize the organizations strategic planning process.

Answered: 1 week ago