Drum Machine failing on test #6 - I've tried everything

Hello fellow campers,

I have searched this problem all over the forum and, although my code works manually and addresses all the common errors that other campers have had (see below) I still can’t pass test #6!!

My drum machine fulfills:

  • able to be triggered manually by keydown
  • checks for keydown, not keypress
  • doesn’t need to be focused on the button to trigger the sound
  • using <button> tag, not <a>
  • checks for event.keyCode

Error from test #6:
No audio plays when the A key is pressed : expected true to be false
(actually slightly different from most of the other forum posts, which say it fails on Q)

Other observations:
When I console long the event.keyCode in handleKeyDown(), I notice that the test doesn’t even press the A key, it presses the Q key, and it also logs from within the block of code that would execute if the key triggered the audio. Not sure why it says that A caused an error then, or why it says the audio didn’t play.

Anyways, here is my repo. Thank you in advance for taking the time to help!

Looks like the order of the keys matter for the tests.
I re-arranged the keys to

Q W E
A S D
Z X C

and the tests passed.

1 Like

@jenovs That was it! Thank you so much for catching that! You know, I thought I had them in order but since I was storing them in an object they were rendering in random order.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.