This is a limited example, so “const” is used.
The code is as follows:
const bobsFollowers = ['James', 'Andy', 'John', 'Jeremy'];
const tinasFollowers = ['Andrew', 'Andy', 'Jeremy']; // Both are limited e.g.s
const mutualFollowers = []; // To be printed after code runs.
for (let i = 0; i < bobsFollowers.length; i++) {
for (let j = 0; j < tinasFollowers.length; j++) {
if (bobsFollowers[i] === tinasFollowers[j]) {
mutualFollowers.push(tinasFollowers[j]); // Push used to edit array.
}
}
}
console.log(mutualFollowers);
Still part of the Codecademy JS course.