Help with Using Objects for Lookups

I’m looking for some help with Basic JavaScript: Using Objects for Lookup (https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/using-objects-for-lookups).

Here is my 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;
}

// Change this value to test
phoneticLookup("charlie");

Whenever I try to click “Run the Tests” nothing happens. Can somebody help me with this issue?

You need to actually assign the object to your look up variable using =

The line @shimphillip is talking about is here.

Thank you! It works now :slight_smile:

1 Like