摘要:
方案一:function randomArr1(arr,num){ var result = [], len = arr.length; for(var i =0; i = len) return result; return result.slice(0,num); }方案二: function randomArr2(arr,num){ var result = [], len = arr.length; for(var i =0; i = len) return result; return result.slice(0,num); } 阅读全文