Tell us what’s happening:
Describe your issue in detail here.
Your code so far
// Setup
function phoneticLookup(val) {
let result = "";
// Only change code below this line
let lookup = {
"alpha": "Adams",
"bravo": "Boston",
"charlie": "Chicago",
"delta": "Denver",
"echo": "Easy",
"foxtrot": "Frank"
}
result = lookup[val];
// Only change code above this line
return result;
}
phoneticLookup("charlie");
I only want to ask what this 👉🏾result = lookup[val]; does
Like what does it display?
Your browser information:
User Agent is: Mozilla/5.0 (Linux; Android 11; TECNO KF6i) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.87 Mobile Safari/537.36
Challenge: Basic JavaScript - Using Objects for Lookups
Inside the function phoneticLookup there is the variable lookup that is being assigned an object with some key/value pairs, and the function is being called with the argument 'charlie'. You should have already done the portion talking about accessing values in objects properties with dot and bracket notation just a few tests back. So if you typed lookup[val] (‘charlie’ would be stored in val) what do you think the value would be based on what is in the lookup object?