obj[key].includes is not a function
// Try using Object.values instead:
var aa = [{id: 1,type: 1,status: 1,name: 'txt'},{id: 2,type: 1,status: 1,name: 'txt'},{id: 3,type: 0,status: 0,name: 'txt'}];
function filterIt(arr, searchKey) {
return arr.filter(function(obj) {
return Object.values(obj).includes(searchKey);
});
}
console.log(filterIt(aa, 'txt'));
Also in JavaScript:
- js email regex
- js remove undefined from object
- get string after character javascript
- array definition js
- jimp get image size
- javascript if undefined
- javascript new date undefined
- javascript range slider
- angular [routerlink]
- vue watch deep
- p5js check for keyboard keys
- stopper un intervalle javascript
- how to get a value into a react component
- javascript voice reader
- list pci express version command line
- javascript string concatenation
- react native add link to text
- jquery nearest
- javascript get last element of array
- vue js default props
- rest api node js with mysql
- javascript check if set contains
- js difference between two numbers
- first name last name concatenate javascript with ternary operator