What happens if we try to run the code below?
const usersList = ['John', 'Larry', 'Maria'];
const newUsers = [];
for(let user of usersList) {
usersList.push('Bob');
newUsers.push(user);
}
console.log(newUsers);What happens if we try to run the code below?
const usersList = ['John', 'Larry', 'Maria'];
const newUsers = [];
for(let user of usersList) {
usersList.push('Bob');
newUsers.push(user);
}
console.log(newUsers);Create a free account to access the full topic