Javascript "Nested Loops" - exercise 6

Hey all, first of all thanks for looking at my post, hopefully you can answer my question.

Exercise Link: https://www.codecademy.com/courses/introduction-to-javascript/lessons/loops/exercises/for-loops-iii

Please see my code below.
I can can log the resulant array to the console, yet I get a ‘Did you write a nested for loop?’ error.

let bobsFollowers = ['Ash','Barry','Calum','Denny'];

let tinasFollowers = ['Ash','Denny','Rob'];

let mutualFollowers = [];

for (i = 0 ; i < bobsFollowers.length ; i++ ) 
  {
    for ( j = 0 ; j < tinasFollowers.length ; j++ )
      {
      if (bobsFollowers[i] === tinasFollowers[j] )
          {
           mutualFollowers.push(bobsFollowers[i]);
          }      
      }
  };
console.log(mutualFollowers);

the console logs the two like names into the array, and the second for loop is clearly nested within so its clearly not a typo error.
I also took care to use the first array as the outer loop following the instructions.

(Note the same error occurs even when removing console.log)

Please advise :slight_smile:

Because I wanted to move on ahead with the lessons I got the answers. I see no visible difference apart from the colon spacing, but I had the belief that this is not an issue for javascript?

let bobsFollowers = ['Joe', 'Marta', 'Sam', 'Erin'];
let tinasFollowers = ['Sam', 'Marta', 'Elle'];
let mutualFollowers = [];

for (let i = 0; i < bobsFollowers.length; i++) {
  for (let j = 0; j < tinasFollowers.length; j++) {
    if (bobsFollowers[i] === tinasFollowers[j]) {
      mutualFollowers.push(bobsFollowers[i]);
    }
  }
};

Hey all, Ive just noticed the mistake which is the 'let i = ’ for each for loop.
(similar format to c since you can skip the ‘let’ bit)

Not sure when this is a necessity though if the result still logs correctly to the console?

I assume it so that each element within the array is assigned to a var, but then couldn’t you just refer to it as [] anyway?