var arr=[1,2,3,4,5,6,7,8,9,10];var arr2=[];$(function(){$('.btn').on('click',function(){var push=arr[Math.floor(Math.random()*arr.length)];arrJoin(push);})});function arrJoin(joinNub){for(var i=0;i<arr2.length;i++){if(joinNub==arr[i]){joinNub=arr[Math.floor(Math.random()*arr.length)];arrJoin(joinNub);}}arr2.push(joinNub);}//每次点击都添加一个新的数字到arr2,不知道哪里没做好,求大神指点
添加回答
举报
0/150
提交
取消