Tell us what’s happening:
I’m getting the expected output but this keeps on showing: When you change the selected category from the dropdown menu, you should log the result of instrumentCards(selectContainer.value) to the console. ![]()
![]()
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
let filteredArr = []
if(instrumentCategory === "all"){
return filteredArr = [...instrumentsArr]
}
for(let i = 0; i < instrumentsArr.length; i++){
if(instrumentsArr[i]["category"] === instrumentCategory){
filteredArr.push(instrumentsArr[i])
}
}
return filteredArr
}
selectContainer.addEventListener("change", () => {
console.log(instrumentCards(selectContainer.value));
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Mobile Safari/537.36
Challenge Information:
Build a Music Instrument Filter - Step 11