Tell us what’s happening:
Hi, some advice would be kind please.
Having looked at all of the hints/results for this challenge, I am convinced that my code is correct. In addition my “console.log” test does have the correct answer (Chicargo).
However the “Run the tests” button in the challenge window yields a console output as below and I can’t proceed because the challenge is marked as incomplete.
The “Run the tests” action is telling me I haven’t got the correct answer - but the console log shows that I DO have the correct answer!
// running tests
phoneticLookup(“charlie”) should equal “Chicago”
// tests completed //
Chicargo
I am intrigued, comments please?
Thanks!
Regards, AlexSch
Your code so far
// Setup
function phoneticLookup(val) {
var result = "";
// Only change code below this line
var lookup = {
alpha:"Adams",
bravo:"Boston",
charlie:"Chicargo",
delta:"Denver",
echo:"Easy",
foxtrot:"Frank"
};
result=lookup[val];
// Only change code above this line
return result;
}
console.log(phoneticLookup("charlie"));
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36
.
Challenge: Using Objects for Lookups
Link to the challenge: