// 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 lookup [val];
// Only change code above this line
return result; **why is this line necessary? considering return lookup[val]; is above**
}
phoneticLookup("charlie");
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36.
It does stop after the first return statement. What I meant to say is that, based on how the starter code is written, taking into account that they declare and return the result variable for you, the assumption is that you won’t write a return statement between the // Only change code... comments.
In code, the person who wrote this challenge expected you to write