Tell us what’s happening:
please someone should help me on this
i am stuck
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",
"" :
};
// Only change code above this line
return result;
}
phoneticLookup("charlie");
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36.
The function parameter val will contain the string “charlie”. Now you can use the parameter (which is just a variable) to do a lookup on the object lookup[val]. Remember to return the value.
Example without a function (the variable userName is like the val parameter).