var num=6; function Girl(beautifulScore){ this.beautifulScore=beautifulScore; } var girls=[]; for (var i = 0; i < num; i++) { girls[i]=new Girl(Math.floor(Math.random()*40+60)); //Math.floor(Math.random()*40+60得到一个60-99的数值,JS没有PHP的range()这样的函数 } girl