Help with Using Objects for Lookups

Help with Using Objects for Lookups
0

#1

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?


#2

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


#3

The line @shimphillip is talking about is here.


#4

Thank you! It works now :slight_smile: