-2
var $playerChoice1 = Math.floor((Math.random()*5+1));
var $playerChoice2 = Math.floor((Math.random()*(10-6+1)+6));
var $playmaking1 = $player+$playerChoice1.playmaking;
var $playmaking2 = $player+$playerChoice2.playmaking;
var $rebounding1 = $player+$playerChoice1.rebounding;
var $rebounding2 = $player+$playerChoice2.rebounding;
ランダムに選んだ$ playerオブジェクト($ player1、$ player2、..、$ player9、$ player10)から値を取得したいとします。最初のプレイヤーは1から5まで、6から10までは選択されています。私のコードは(もちろん)動作しません。私はそれをどのように扱うべきですか?オブジェクト参照を作成するにはどうすればよいですか?