Basic JavaScript - Using Objects for Lookups

Tell us what’s happening:
Describe your issue in detail here.

Your code so far

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

  // Only change code below this line
  const 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/116.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Using Objects for Lookups

Link to the challenge:

your solution passes for me, so there may be a browser issue

You can post solutions that invite discussion (like asking how the solution works, or asking about certain parts of the solution). But please don’t just post your solution for the sake of sharing it.
If you post a full passing solution to a challenge and have questions about it, please surround it with [spoiler] and [/spoiler] tags on the line above and below your solution code.

I have blurred your code to avoid spoilers.

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