Learn Intermediate OOP by Building a Platformer Game - Step 53

Tell us what’s happening:

I don’t understand why it’s not pass. I mean value === key or something else

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

switch() {
  default: value = key
}

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36

Challenge Information:

Learn Intermediate OOP by Building a Platformer Game - Step 53

1 Like

Hi there,

The syntax for switch statement is:

switch (expression) {
  case caseExpression1:
    statements
  case caseExpression2:
    statements
  default:
    statements
}

When the instruction said:

create a switch statement with a value of key

That means expression here is key

1 Like

thank you, I’ve done it

1 Like