Here's what i have at the moment:
let userTeams = ['Liverpool', 'Manchester City', 'Manchester United'];
let object = {
teams: {
'Liverpool': {
player:
['Salah',
'Nunez']
},
'Manchester United': {
player:
['Ronaldo',
'Rashford']
},
'Manchester City': {
player:
['Haaland',
'Foden']
},
},
};
let userTeam = userTeams[Math.floor(Math.random() * 3)];
I need the team selection to be directly but randomly from the object rather than from the userTeams array.
How would i go about that?