我无法弄清楚我在这里做错了什么:
(错误在第4行,我相信还有更多):
var RPSPlayer =
{
myHistory = new array();
rivalRock = 0;
rivalScissors = 0;
rivalPaper = 0;
itemChosen;
victorySum;
this.choose=function(item)
{
myHistory.push(item);
};
...
{more code here}
答案 0 :(得分:2)
你是对的,还有更多。快速更正:
var RPSPlayer = {
myHistory: [],
rivalRock: 0,
rivalScissors: 0,
rivalPaper: 0,
choose: function(item) {
this.myHistory.push(item);
}
};