const bobsFollowers = [‘Jim’, ‘John’, ‘Frank’, ‘Tom’];
const tinasFollowers = [‘Jack’, ‘Jim’, ‘Frank’];
const 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]);
}
}
}
You have a syntax error after the clause for the 2nd for loop: The semicolon doesn’t belong there.
Please mind the guide for code formatting in future posts:
To format code so it’s visible, either wrap it in single backticks (``` ``) for a small amount of code, or triple backticks on an otherwise blank line before and after for a large amount of code.
2 Likes
Oops! I thought I was going nuts. Thanks for the help!
1 Like