I need help on the lesson: Replacing If Else Chains with Switch in free code camp!

I don’t know how to do it. At there is no hint so please help.

What have you tried? What part is working? What isn’t working? Where do you get confused? Which parts do you understand?

I have try tried putting all the if else into the switch and write them as a case. I wrote case bob: but it said bob is undefind.

You won’t have any if or else statements. You’ll have a switch instead.

Be careful that there is a difference between bob and "bob"

(bob === "bob") // this is false, they are different things

Look at how it is used in the if else chain

And if you post what you have tried or what part of the instructions you did not understand, we can give advices on that.

You haven’t posted your code here. None of us know what you’ve tried, other than what you’ve said. Makes it difficult.

From the lesson itself, there is a button, “Ask for help” – this will actually format a post for you, with a link to the lesson in question (https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/replacing-if-else-chains-with-switch) and with the code you’ve tried. It won’t tell us what you got for a result, but usually we can figure that out.