i have added a keydown event listener to the document, when a key is pressed, the corresponding audio gets selected and played. and then the audio object with the corresponding id is filtered out from the array of audio objects, and the text of the required audio is sent to the display.
Its all working on screen, but as per the tester, the required audio is never filtered out from the array correctly, so it becomes undefined.
Although the audio is getting filtered correctly as per the console logs i have tried.
Here is a codepen link to my project.
The error is at somewhere around line 27.
I am using google chrome as the browser.
Challenge: Build a Drum Machine
Link to the challenge: