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"
};
result = lookup[val]
// Only change code above this line
return result;
}
Tell us what’s happening:
I’m just wondering why
result = lookup[val]
I did everything in this challenge except that. Thought it may be the property statement but if it’s lookup.val it’s incorrent.
Hey Bosch,
your coding looks fine and it matches my solution apart from capital F in frank that was pointed out, and a missing ; at the end of result = lookup[val].
I dont think you need the console.log() though.
phoneticLookup(“charlie”);
should do it, and just change “charlie” to “bravo” etc to test.
I only did this last night myself buddy so its a best guess.
Also I believe using the .val instead of [val] has to do with the properties being a variable instead of constant? I’ve seen this causing issues for other people on other parts of challenges.
try changing it back to
result = lookup[val];