Filter string from array
const myArray = ["1", 1, 2, 3, 4, 5,]
const result = myArray.filter((item) => {
if(typeof(item) === 'string')
return item;
});
console.log(result);
Filter array object by another array
let array2 = ['senior web developer', ' React-Native Developer']
let backupInterviews = **[{…}, {…}, {…}, {…}, {…}, {…}, {…}]**
let filterData = backupInterviews.filter(item =>
array2.includes(item.desig))
console.log("filterData", filterData)
Top comments (0)