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);}//每次點(diǎn)擊都添加一個(gè)新的數(shù)字到arr2,不知道哪里沒(méi)做好,求大神指點(diǎn)
arr2數(shù)組添加內(nèi)容時(shí)不能與之前的內(nèi)容重復(fù)
彬彬有理_0
2018-01-17 11:35:32