Tell us what’s happening:
Question: Do I have to made empty var Result?
Even though I got rid of 'VAR RESULT = “”, it works… Why is that?
Your code so far
// Setup
function phoneticLookup(val) {
// --Question: Do I have to made empty var Result? Even though I got rid of line5, it works.. Why is that?
// var result = "";
// Only change code below this line
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("alpha");
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
.
Link to the challenge:
https://www.freecodecamp.org/challenges/using-objects-for-lookups