/*Hi,
I don’t understand why my code isn’t working - I used a for loop instead of a while loop. (this is without the bonus ‘part’):.
I have tried placing
admitted.textContent = “Admit”:;
refused.textContent = “Refuse”:
just before the for loop and also just before the closing } of the for loop, but neither of those solutions make any difference. What am I missing?*/
const people = [‘Chris’, ‘Anne’, ‘Colin’, ‘Terri’, ‘Phil’, ‘Lola’, ‘Sam’, ‘Kay’, ‘Bruce’];
const admitted = document.querySelector(’.admitted’);
const refused = document.querySelector(’.refused’);
for (let i = 0; i < people.length; i++) {
admitted.textContent = 'Admit: ';
refused.textContent = 'Refuse: ‘;
if ((people[i] === “Lola”) || (people[] === “Phil”) ) {
refused.textContent += people[i] + ", ";
}
else {
admitted.textContent += people[i] + ", ";
}
}
/*All my best,
Sarah */