JavaScript Basics - Using Objects for Lookups

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

I am getting an error, it seems to be emanating from the point where I declared the “lookup” object but the syntax seems. I need help cos I might have missed sth
Your code so far


// 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];
// Only change code above this line
return result;
}

phoneticLookup("charlie");
  **Your browser information:**

User Agent is: Mozilla/5.0 (Linux; Android 9; Infinix X650D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.101 Mobile Safari/537.36

Challenge: Using Objects for Lookups

Link to the challenge:

Hi, I guess deleting " , " after “Frank” should help fix it. Hope this helps.

1 Like

Just did, the error is still there

Could you post the error message you are getting?

1 Like

You are missing “=” after lookup

1 Like

It works! Thanks a lot. Been stuck here since yesterday

Welcome. Glad to be able to help