hi there,
I had a strugle with this exercise, first I was using this code:
// Setup
function phoneticLookup(val) {
var result = “”;
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;
}
// Change this value to test
phoneticLookup(“charlie”);
and result = lookup.val; didnt pass, but as soon I changed it to result = lookup[val]; I passed…
in before exercises I was using both . notation and brackets to enter objects properties…
Can you please let me know why dot notation didnt work for this case? as Im not getting this one…
Thanks