Created
February 14, 2016 14:55
-
-
Save jastuccio/25dbb7f1cd835585c2c1 to your computer and use it in GitHub Desktop.
"using objects for lookups" http://www.freecodecamp.com/challenges/using-objects-for-lookups
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you! I was stuck on that. I know I had it right, but something was missing.