-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;
임의로 선택한 $ 플레이어 개체 ($ player1, $ player2, .., $ player9, $ player10)에서 값을 가져오고 싶습니다. 첫 번째 플레이어는 1에서 5 사이에서 선택되고 다른 플레이어는 6에서 10 사이에서 선택됩니다. 물론 내 코드가 작동하지 않습니다. 어떻게 처리해야합니까?개체 참조를 만들려면 어떻게해야합니까?