Javascript snake game for learning