Become a member
Sign in
Kashif Dar
Kashif Dar

Kashif Dar

2 Following
  • Profile
  • Highlights

Highlighted by Kashif Dar

See more

From Comparison of Two arrays Using JavaScript by Sai gowtham

function compare(arr1,arr2){

if(!arr1 || !arr2) return

let result;

arr1.forEach((e1,i)=>arr2.forEach(e2=>{

if(e1.length > 1 && e2.length){
result = compare(e1,e2);
}else if(e1 !== e2 ){
result = false
}else{
result = true
}
})
)

return result

}