Lookups using objects

Tell us what’s happening:
Describe your issue in detail here.
I have deleted and reset this several times. Usually I can look at it and see the space or extra comma, but this is really gotten me. I don’t understand the error that keeps coming up or asking me to not use a switch statement.

  **Your code so far**

// Setup
function phoneticLookup(val) {
var result = "";

// Only change code below this line
var lookup ={
  "alpha":"Adams",
  "bravo":"Boston",
  "charlie":"Chicago",
  "delta":"Denver",
  "echo":"Easy",
  "foxtrot":"Frank",

};
result = lookup[val];

}

// Only change code above this line
return result;
}

phoneticLookup("charlie");
  **Your browser information:**

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

Challenge: Using Objects for Lookups

Link to the challenge:

You’ve got an extra closing curly brace in there.

2 Likes

Thank you. I decided to step away for a minute and go back to it. As soon as I looked it over again line by line I saw what I thought would be the problem and saw your response as well.
Again Thank you, a ruff hour.

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