Get Unique Array value from two array in javascript

 

var data = [1 ,9];

// console.log(‘data’, data);
var newdata = [1 ,2 ,3,9];
newdata.forEach((item, index)=>{

if(data.indexOf(item) == –1 ) {
console.log(‘not found ‘, item);
}

})

Leave a Comment

Your email address will not be published. Required fields are marked *