let myAdmins = [“ahmed”, “osama”, “sayed”, “stop”, “samira”];
let myEmployees = [“amgad”, “samah”, “ameer”, “omar”, “othman”, “amany”, “samia”]
document.write(<h1> We Have ${myAdmins.slice(0, 3).length} Admins</h1>
);
for (let i = 0; i < myAdmins.length; i++) {
document.write(<div>
)
document.write(<p>The Admin for team ${i + 1} ${myAdmins[i]}</p>
);
document.write(<h2>Team Memebers:</h2>
);
for (let j = 0; j < myEmployees.length; j++) {
if(myAdmins.charAt(0) === myEmployees.charAt(0)) {
document.write(${myEmployees}
);
}
}
document.write(<hr>
)
document.write(</div>
);
if (myAdmins[i + 1] === "stop") {
break;
}
}
the code should work something like this:
team members of admin Ahmed :
Alaa
Amil
Ados
something like that.
I just want a clue not the a full answer so I can get more practice at this.
Thank you!
Mohamed Alaa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.