Hey, I encountered a problem there is a simple exercise, but I’m not sure that my logic is correct.
anyone could me help ?
Your code so far
// 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"
};
var value = val;
result += lookup[value];
// Only change code above this line
return result;
}
// Change this value to test
phoneticLookup("charlie");
But still when I call function with empty string parameter. test shouts phoneticLookup("") should equal undefined