I can not figure it out why this function doesn't return true...
function isTheTeamPlaying(teamID, meetings) {
meetings.forEach( element => {
if (element.includes(teamID.toString())) {
console.log(element); //Return '0-1' and '1-2'
return true;
}
})
}
console.log(isTheTeamPlaying('1', ['0-1', '0-2', '0-3', '1-2'])); //Return undefinded
I was expecting the second cosole.log() to return true