i and j are index values. You need to use them to get to the elements inside the arrays. Them multiply the elements (not the indexes). Look at the example code on how to access the elements. for (let i = 0; i < arr.length; i++) { for (let j = 0; j < arr[i].length; j++) { console.log(arr[i][j… Answer from lasjorg on forum.freecodecamp.org
🌐
freeCodeCamp
freecodecamp.org › news › nesting-for-loops-in-javascript
Nesting For Loops in JavaScript
June 2, 2020 - If you're having trouble understanding freeCodeCamp's Nesting For Loops challenge, don't worry. We got your back. In this problem you have to complete the multiplyAll() function, and takes a multi-dimensional array as an argument. Remember that a mul...
🌐
freeCodeCamp
forum.freecodecamp.org › guide
freeCodeCamp Challenge Guide: Nesting For Loops - Guide - The freeCodeCamp Forum
July 12, 2019 - Nesting For Loops Problem Explanation Relevant Links Nest One Array Within Another Array Iterate Through An Array With A For Loop Accessing Nested Arrays Hints Hint 1 Make sure to check with length and not the overall array. Hint 2 Use both i and j when multiplying the product.
Discussions

Nesting For Loops freeCodeCamp
In the challenge “Nesting For Loops” in freeCodeCamp, I’m not sure how this piece of code does what the challenge says it does. for (var i=0; i More on forum.freecodecamp.org
🌐 forum.freecodecamp.org
0
0
February 5, 2018
Nesting for Loops
Can anyone explain to me why I is a subarray here? Is it because I =0? but then we also declared J = 0 so im a bit confused · This outputs each sub-element in arr one at a time. Note that for the inner loop, we are checking the .length of arr[i], since arr[i] is itself an array · When you ... More on forum.freecodecamp.org
🌐 forum.freecodecamp.org
0
1
January 28, 2020
Explain nesting for loops
Hi all, I have a few questions regarding the answer to the nesting for loops challenge. I just would like a better explanation. (Spoilers below) in regards to the i++ and j++ why is this necessary, where does the challenge say we have to add by one - dont get this at all. More on forum.freecodecamp.org
🌐 forum.freecodecamp.org
0
0
July 13, 2021
Nesting For Loops
I have problems with this exercise. Can you help me? I think I have followed your instructions but it does not work · Hi, if you still need help: As I can see, in your embedded for loop you don’t use the .length method on your array in the condition part. You have: for (var j = 0; j < arr[i]; ... More on forum.freecodecamp.org
🌐 forum.freecodecamp.org
0
2
June 16, 2016
🌐
freeCodeCamp
forum.freecodecamp.org › javascript
Nesting For Loops freeCodeCamp
February 5, 2018 - In the challenge “Nesting For Loops” in freeCodeCamp, I’m not sure how this piece of code does what the challenge says it does. for (var i=0; i < arr.length; i++) { for (var j=0; j < arr[i].length; j++) { console.log(…
🌐
freeCodeCamp
forum.freecodecamp.org › javascript
Nesting for Loops
January 28, 2020 - Can anyone explain to me why I is a subarray here? Is it because I =0? but then we also declared J = 0 so im a bit confused? const arr = [ [1, 2], [3, 4], [5, 6] ]; for (let i = 0; i < arr.length; i++) { for (let …
🌐
freeCodeCamp
forum.freecodecamp.org › javascript
Explain nesting for loops - JavaScript
July 13, 2021 - Hi all, I have a few questions regarding the answer to the nesting for loops challenge. I just would like a better explanation. (Spoilers below) in regards to the i++ and j++ why is this necessary, where does the ch…
🌐
freeCodeCamp
forum.freecodecamp.org › javascript
Nesting For Loops - JavaScript
June 16, 2016 - I have problems with this exercise. Can you help me? I think I have followed your instructions but it does not work · Hi, if you still need help: As I can see, in your embedded for loop you don’t use the .length method on your array in the condition part. You have: for (var j = 0; j < arr[i]; ...
Find elsewhere
🌐
freeCodeCamp
forum.freecodecamp.org › javascript
The nesting For loops - JavaScript
June 15, 2021 - Tell us what’s happening: Hi, I need help. I do understand the For loops, at least most of them. I am stuck at the lesson of The Nesting For Loops, I want to know all the hows and whys, so far, i do understand all the way to 5040 ( where’s it comes from and how to get there) , however, ...
🌐
freeCodeCamp
forum.freecodecamp.org › guide
freeCodeCamp Challenge Guide: Nesting For Loops - #20 by thelynguist - Guide - The freeCodeCamp Forum
July 9, 2017 - Nesting For Loops Problem Explanation Relevant Links Nest One Array Within Another Array Iterate Through An Array With A For Loop Accessing Nested Arrays Hints Hint 1 Make sure to check with length and not the …
🌐
GitHub
github.com › Manish-Giri › FreeCodeCamp › blob › master › curriculum › challenges › english › 02-javascript-algorithms-and-data-structures › basic-javascript › nesting-for-loops.english.md
FreeCodeCamp/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/nesting-for-loops.english.md at master · Manish-Giri/FreeCodeCamp
If you have a multi-dimensional array, you can use the same logic as the prior waypoint to loop through both the array and any sub-arrays. Here is an example: var arr = [ [1,2], [3,4], [5,6] ]; for (var i=0; i < arr.length; i++) { for (var j=0; ...
Author   Manish-Giri
🌐
Stack Overflow
stackoverflow.com › questions › 63387366 › freecodecamp-basic-javascript-nesting-for-loopspassed
Freecodecamp Basic JavaScript: Nesting For LoopsPassed - Stack Overflow
0 Nested loop iteration · 2 Two layers for loop in `JavaScript` 0 Javascript - Looping a nested Loop · What are the current COVID-19 entry requirements for US Citizens to Bali? How am I supposed to put a thru-axle hub in my truing stand? Increasing pizza dough "flavor"?
🌐
freeCodeCamp
forum.freecodecamp.org › t › can-someone-explain-nested-for-loops › 190026
Can someone explain nested for loops? - The freeCodeCamp Forum
May 8, 2018 - So i know how loops work at least not untill nested ones, so the way i figured out this challenge https://www.freecodecamp.org/challenges/nesting-for-loops inner loop aka nested loop calculates numbers in nested arrays
🌐
freeCodeCamp
forum.freecodecamp.org › javascript
Nesting for loops - multiplying
March 27, 2018 - Tell us what’s happening: hi guys, don’t understand what means the orders which I uploaded. Your code so far function multiplyAll(arr) { var product = 1; // Only change code below this line for (var i = 0; i < arr.le…
🌐
freeCodeCamp
forum.freecodecamp.org › javascript
Need help understanding - Nesting For Loops - JavaScript
July 5, 2017 - Hi All! So I have been doing a bit of web design for a few years, so I honestly whipped through the HTML & CSS, but now I’m in JS and per usual I’m stuck on loops! I just completed the Nesting for Loops challenge, but …
🌐
freeCodeCamp
forum.freecodecamp.org › javascript
What do i and j actually represent? - Basic JavaScript - Nesting For Loops - JavaScript - The freeCodeCamp Forum
July 11, 2023 - Tell us what’s happening: Hey all! New to JavaScript, I’ve got the solution for this, but I don’t understand what’s actually happening in the loop. I’m going to try my best to explain what I think is happening, and I ho…
🌐
freeCodeCamp
forum.freecodecamp.org › javascript
Basic JavaScript: Nesting For Loops - Solution not accepted? - JavaScript - The freeCodeCamp Forum
July 18, 2018 - Here’s the exercise from FreeCodeCamp: Basic JavaScript: Nesting For Loops If you have a multi-dimensional array, you can use the same logic as the prior waypoint to loop through both the array and any sub-arrays.
🌐
freeCodeCamp
forum.freecodecamp.org › t › problem-with-nesting-for-loops › 32832 › 16
Problem with nesting for loops - #16 by SerafimPoch - The freeCodeCamp Forum
February 13, 2017 - It is very simple to understand if you don’t think how it works 😄 For loop just extracts some items from array. At this time very little group of programmers use for loop.Try instead- array.map( ).It is the same for loop but with less code and problems.