Skip to content

Instantly share code, notes, and snippets.

@jastuccio
Created February 14, 2016 14:55
Show Gist options
  • Star 21 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save jastuccio/25dbb7f1cd835585c2c1 to your computer and use it in GitHub Desktop.
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");
@lbendror
Copy link

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");

@sabrinamary
Copy link

Thank you! I was stuck on that. I know I had it right, but something was missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment