Build a Drum Machine - user story #6

Build a Drum Machine - user story #6
0

#1

Tell us what’s happening:

Hello,

Could I ask for help with “Build a Drum Machine” React challenge? It seems to me that everything works perfectly fine but I am unable to pass test #6 and I can’t figure out why. Link to Codepen below.

Many thanks for any help!
Stepan

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0.

Link to the challenge:
https://learn.freecodecamp.org/front-end-libraries/front-end-libraries-projects/build-a-drum-machine


#2

here is the solution to your problem.

  handleKeyPress(event) {
    let foo = event.key.toLowerCase()
    if (keys.indexOf(foo) > -1) {
        
      this.playSound(event.key);
      
    }
  }

What the tests wanted you to accomplish is for the drum machine to work regardless if the event.key is lower case or uppercase.

adding let foo converts every input to lower case.


#3

Brilliant! Thank you very much.