此处直接调用数组的随机索引即可,无需-1

#2 · open · 0 comments

View on GitHub ↗

huluoyang

https://github.com/S1ngS1ng/freeCodeCampProject/blob/57ce81bacde8e6180e71188d7b5037173aee4498/poker-game/lib/generate.js#L77 ``` card.suit = this.suit[this._getRandomIndex(this.suit.length)]; ```

Comments