I know this is a super noob question.
I'm expecting to give a random string to player 2 and compare it to the player... I can see player2 being reassigned , however the if statement doesn't seem to work.
let player = 'paper';
let player2 = '';
let myarr = ["rock", "paper", "scissors"];
var index = Math.floor(Math.random() * 3);
player2 = myarr[index];
console.log(player2);
function compare() {
if (player === player2)
console.log("draw");
}
compare(); // you missed this (added by editor)