JavaScript: Using Objects for Lookup

i honestly don’t know whats wrong with the code

// 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",

   // Only change code above this line
  return lookup[val];

// Change this value to test

can you provide a link to the challenge?

also looks like you have an extra comma at the end of this line…

I’ve edited your post for readability. When you enter a code block into the forum, precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.


See that comment? You were not supposed to modify the original line of code which was:

return result;

The instructions are quite specific in what you are to do:

Use it to look up val and assign the associated string to the result variable.

You have the right idea, but you just need to assign what you were returning to the result variable declared in the function, so the tests can validate you did it correctly.