Mixed Messages - Solution

//here is the project solution

const player = [‘De Gea’, ‘Grant’, ‘Heaton’, ‘Henderson’, ‘Lindelof’, ‘Baily’, ‘Jones’, ‘Maguire’, ‘Varane’, ‘Dalot’, ‘Shaw’, ‘Telles’, ‘Wan-Bissaka’,

'Williams', 'Tuanzebe', 'Mengi', 'Pogba', 'Mata', 'Lingard', 'Pereira', 'Amad', 'Fred', 'Fernandes', 'Pellistri', 'Matic', 'Van De Beek', 'Garner', 'Mctominay',

'Hannibal', 'Rolando', 'Martial', 'Rashford', 'Greenwood', 'Cavani', 'Sancho', 'Elanga', 'Chong', 'Shoretire'

];

const probability = [‘will’, ‘will not’, ‘should’, ‘should not’, ‘may’, ‘may not’];

const action = [‘score’, ‘play’, ‘get causioned’, ‘get a foul’, ‘get injured’, ‘score a brace’];

const selectPlayer = player[Math.floor(Math.random() * player.length)];

const selectProbability = probability[Math.floor(Math.random() * probability.length)];

const selectAction = action[Math.floor(Math.random() * action.length)];

function mixedMessage() {

console.log(`${selectPlayer} ${selectProbability} ${selectAction}`)

};

mixedMessage();

1 Like

Was great working with you on this. Our code is pretty much exact bar the variable names :grinning:

1 Like