Basic JavaScript - Using Objects for Lookups

Tell us what’s happening:

why this code is not passing

Your code so far

// Setup
  // Only change code below this line
 function phoneticLookup(val) {
  let result = "";
 
   result = {
    "alpha": "Adams",
    "bravo": "Boston",
    "charlie": "Chicago",
    "delta": "Denver",
    "echo": "Easy",
    "foxtrot": "frank"
  }[val];
  // Only change code above this line
  return result;
}



phoneticLookup("foxtrot");

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36

Challenge Information:

Basic JavaScript - Using Objects for Lookups

Can you tell us more? What tests are failing?

2 Likes

frank was in lower case, I changed it to Frank and it worked

3 Likes

Good finding the issue on your own. I was waiting for your response to share it. Instead you get the solution. Keep up the good progress @bobmoss14

1 Like

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