<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script>
function search(a,b){
var resultArr=[];
for(var i=0;i<a.length;i++){
for(var j=0;j<b.length;j++){
if(b[j]==a[i]){
if(resultArr.indexOf(a[i])<0){
document.write(a[i]+"<br/>");
}
break;
}
}
}
return resultArr;
}
search([1,2,3,4,5,6,7],[6,8,true]);
</script>
</head>
<body>
</body>
</html>