I have to filter an array, it doesn't work for my project. This is the code: edit: This is the whole code: http://collabedit.com/2prqs
$("#searchBar").on("keyup", function(e){
const searchString = e.target.value;
console.log(searchString)
let filteredCoins = coinsArray.filter((coin) => {
return coin.symbol.includes(searchString);
});
console.log(filteredCoins)
})
and this is the error I'm getting:
Uncaught TypeError: Cannot read property 'includes' of undefined
Does anyone know why?
Via Active questions tagged javascript - Stack Overflow https://ift.tt/2FdjaAW
Comments
Post a Comment