-
-
Save jastuccio/25dbb7f1cd835585c2c1 to your computer and use it in GitHub Desktop.
// 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" | |
}; | |
result = lookup[val]; | |
// Only change code above this line | |
return result; | |
} | |
// Change this value to test | |
phoneticLookup("charlie"); |
var lookup = {
alpha:"Adams",
bravo:"Boston",
charlie:"Chicago",
delta:"Denver",
echo:"Easy",
foxtrot:"Frank"
};
result = lookup[val];
Nothing but the last two conditions are met. I don't know how this code is working for anyone else.
Thank you very much!
Wow, their questions can be confusing at times.
But I believe it is crafted that way to make one really think.
thank you so much. I sensed that the solution would be quite simple, but could not formulate it clearly...
This is the right code:
// 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"
};
result = lookup[val]; // Square brackets
// Only change code above this line
return result;
}
phoneticLookup("Charlie");
Thank you! I was stuck on that. I know I had it right, but something was missing.
Thanks dude!!