Build a Space Mission Roster - Step 4

Tell us what’s happening:

Solution did not work, not sure what is going wrong with my solution

Your code so far

const squad = [];

const firstAstronaut = {
  id: 1,
  name: "Andy",
  role: "Commander",
  isEVAEligible: true,
  priority: 3
};


// User Editable Region

function addCrewMember(crew, astronaut) {
  for(astros of crew){
    if (astros.id === astronaut.id) {
    console.log("Duplicate ID: " + astronaut.id);
    return;
}

// User Editable Region

}
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0

Challenge Information:

Build a Space Mission Roster - Step 4

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/workshop-space-mission-roster/694c9c186c089f7bdff0f3c6.md at main · freeCodeCamp/freeCodeCamp · GitHub

Welcome to the forum @d3911ready!

Have you correctly declared your loop variable?

Happy coding!

This helped thank you!