marge common element of to array into one array February 21, 2021 function common(arr1, arr2) { debugger; var newArr = []; newArr = arr1.filter(function (v) { return arr2.indexOf(v) >= 0; }) newArr.concat(arr2.filter(function (v) { return newArr.indexOf(v) >= 0; })); return newArr; } Share Get link Facebook X Pinterest Email Other Apps Share Get link Facebook X Pinterest Email Other Apps Comments
Comments
Post a Comment