I have following code snippet which should return all the team names of a agile team. But code returns undefined
. I have already tried let _this = this;
and replaced this
with _this
but no result. Can anyone help me with this please.
let teamSelector = {
teams: ['Team Alpha', 'Team Beta', 'Team Delta'],
selectTeam: function(members){
// let _this = this;
return members.map((member)=>{
return `${member} is on ${this.teams[Math.random() * 3]}`;
});
}
};
teamSelector.selectTeam(['Anna','Jhon','Kevin','Lesli']);