获取数组中不存在的值

var a=['18189278905','13981562141','15296666398','15618127501','18811489608','15547805499','15856541799','13480126869','18811786083','18847780532','15024882708','13403909156','15072759091','15092019862','13520113290','18486377710','18090087516','13639596559','15988815180','18463287039','13535212518','18378301011','19939943935','15083097271','15088073201','13405446630','18670060283','18669853690','13914548477','15901581255','15297912885','13794671276','15882527496','19859076030','13658917726','15934529350','13844512186','18569833187','15993211239','15208297991','18777649456','13555186810','18159049266','18622551802','13658868651','18209540600','18107356120','18917388633','18207889588','15028789263','18972770794','18850223177','13123611501','13481248752','18611142635','18278117697','18801168079','18252219650','15103466462','15982211647','13466849800','13599232343','13070457588','13612659661','18931007785','18218973790','13706504925','18368606260','15836801772','15989419520','18692255999','15101763650','13544716803','13510215307','18624457831','17776266353','13791783762','13715127672','18818691393','13948290495','18826479395','13106963368','15846142358','14709531635','15950056939','15369173586','13855539858','13995206055','15297013634','15191840739','13385127070','18386681993','15998566880','13682233353','17707295897','15002012039','13913056673','13998506155','18435118096','18179101315','13982731416','13529199774','15676772611','15778000609','13654392657','13926635221','18636857335','13420787747','18226151002','18311443614','13668550032','15913366329','13786025708','15234718538'];


var b=["18624457831","13420787747","18611142635","15191840739","17707295897","13529199774","15676772611","15882527496","13844512186","13844512186","15901581255","13995206055","18278117697","15988815180","18847780532","15028789263","13555186810","13555186810","13420787747","15297013634","15882527496","18622551802","13070457588","13844512186","13070457588","18622551802","13420787747","13405446630","13480126869","13420787747","13481248752","15072759091","18847780532","18486377710","13420787747","13654392657","18611142635","18622551802","18622551802","18622551802","13982731416","15103466462","15882527496","13420787747","13612659661","13926635221","13844512186","13420787747","13466849800","15208297991","18818691393","13668550032","13668550032","15982211647","15846142358","18826479395","13844512186","13668550032","15836801772","13913056673","15676772611","13481248752","13480126869","13555186810","13982731416","18611142635","18368606260","13658868651","18226151002","13914548477","18386681993","18386681993","15072759091","15072759091","18818691393","15998566880","13844512186","13123611501","13510215307","13914548477","13998506155","15846142358","18622551802","13480126869","13715127672","18826479395","13998506155","13982731416","13658868651","18226151002","13612659661","18569833187","13682233353","18622551802","13481248752","13481248752","18669853690","13715127672","18218973790","18636857335"]
var flag=false;
for(var i=0;i<a.length;i++){
flag=false
for(var j=0;j<b.length;j++){
if(a[i]==b[j]){
flag=true;
break;
}
}
if(!flag)console.log(a[i])
}

  

posted on 2020-04-10 10:05  神奇的旋风  阅读(574)  评论(0编辑  收藏  举报

导航