Basic JavaScript - Using Objects for Lookups

Tell us what’s happening:

Describe your issue in detail here.
Can anyone please help my find where is the bug in my code.

Your code so far

var lookup = {
“alpha”: “Adams”,
“bravo”: “Boston”,
“charlie”: “Chicago”,
“delta”: “Denver”,
“echo”: “Easy”,
“foxtrot”: “Frank”
}
result = lookup(val)
console.log(result)

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

  // Only change code below this line
  var lookup = {
    "alpha": "Adams",
    "bravo":  "Boston",
    "charlie": "Chicago",
    "delta": "Denver",
    "echo": "Easy",
    "foxtrot": "Frank"
  }
     result = lookup(val)
     console.log(result)
  

  // 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/119.0.0.0 Safari/537.36

Challenge Information:

Basic JavaScript - Using Objects for Lookups

Hello!
I suggest trying to change the parenthese that are around the result lookout to see if it will pass. You are needing a string returned, but are currently stating that lookup is a function by using the parentheses. You may wish to try brackets

Happy coding! :sun_with_face:

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