Freecodecamp: Using Objects for Lookups

Created on 17 Jan 2016  ·  3Comments  ·  Source: freeCodeCamp/freeCodeCamp

screen shot 2016-01-17 at 1 06 00 pm
Challenge Using Objects for Lookups has an issue.
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36.
Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:

// Setup
var phoneticLookup = {
  "alpha": "Adams",
  "bravo": "Boston",
  "charlie": "Chicago",
  "delta": "Denver",
  "echo": "Easy",
  "foxtrot": "Frank"
};

// Change this value to test
var val = "bravo";
val = phoneticLookup[val];

Most helpful comment

Hello,
I just passed this exercise and I believe that was too tricky. In the default code you should write that it's ok if you change the return command too. I had a hard time because I though I'm not supposed to change it...

All 3 comments

You are not suppose to change the whole code. Just change the switch statement to a lookup table and make it so that result returns the correct value.

If you need help, please go to the main room or the help room. GitHub is used only for issues.

Hello,
I just passed this exercise and I believe that was too tricky. In the default code you should write that it's ok if you change the return command too. I had a hard time because I though I'm not supposed to change it...

I am having a problem with this because the example does not even show where the "lookup" operation is meant to be. Why have an example if it leaves out what is supposed to be happening?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

raisedadead picture raisedadead  ·  3Comments

DaphnisM picture DaphnisM  ·  3Comments

SaintPeter picture SaintPeter  ·  3Comments

EthanDavis picture EthanDavis  ·  3Comments

trashtalka3000 picture trashtalka3000  ·  3Comments