I\'m learning javascript and I decided to create simple Rock, Paper, Scissors game. I want to make it controllable by buttons. So I made this in html:
var is used for declaring a variable. You don't need to declare user variable again in user function. You just need to assign a value to declared one.
var
user
var user; //declaration function user(choice) { user = choice; //assignment }