var tmp = new Array();
var org_random = new Array(1,2,3,4,5,6,7,8,9,10);//此为全集
<pre name="code" class="javascript">var already_drawparts = new Array(3,5,6,10);
tmp = two_arr_chaji(org_random,already_drawparts);
<script>function two_arr_chaji(org_random,already_drawparts){var new_tmp = new Array(); for(var i=0;i<org_random.length;i++){ //alert(already_drawparts[i]); var flag = true; for(var j=0;j<already_drawparts.length;j++){//alert(typeof(org_random[j])); if(org_random[i] == already_drawparts[j]){flag = false; } } if(flag){new_tmp.push(org_random[i]); }}return new_tmp;}</script>
//输出为:
1,2,4,7,8,9