Rock, paper, scissors in JavaScript