function difference(arr1,arr2) { var a1= flatten(arr1,true); var a2= flatten(arr2,true); var a=[], diff=[]; for(var i=0;i