JavaScript "phoneticLookup("") should equal undefined"

Tell us what’s happening:
Hello Community
I just can’t pass this challenge because of the answer : “phoneticLookup(”") should equal undefined"
I don’t know where to modify the code.

**


// 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",
  " " return undefined
  };
result += lookup[val];

// Only change code above this line
return result;
}

phoneticLookup("");

**

  **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36.

Challenge: Using Objects for Lookups

Link to the challenge:

there was a mistake in += . I changed it into = and the code worked.
I thought += would display all values and i was wrong.
So Topic is closed.

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