Game of rock, paper, scissors in JavaScript