As the module’s go on, I find myself being increasingly more fustrated with JavaScript (I don’t expect to know everything of course). I totally understand the example they give but I am a little confused as to what they want me to do…actually I do understand what they want me to do but I can’t seem to do it.
Can some please help to explain it??
Also, I would love a bit of advice. I’m quite confident in remembering a lot of JavaScript’s syntax and doing basic problem solving but as the modules go on, I’m becoming more and more lost. Should I stop from this point on and go back to the beginning or buy a book (I actually purchased Jon Ducket’s JavaScript Book). I don’t want to complete the challenges for the sake of it if that makes sense.
Thanks guys
**Your code so far**
// Setup
function phoneticLookup(val) {
var result = "";
// Only change code below this line
/* switch(val) {
case "alpha":
result = "Adams";
break;
case "bravo":
result = "Boston";
break;
case "charlie":
result = "Chicago";
break;
case "delta":
result = "Denver";
break;
case "echo":
result = "Easy";
break;
case "foxtrot":
result = "Frank";
break;
}*/
var lookup = {
"alpha": "Adams",
"bravo": "Boston",
"charlie": "Chicago",
"delta": "Denver",
"echo" : "Easy",
"foxtrot": "Frank",
}
// Only change code above this line
return result;
}
phoneticLookup("charlie");
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36
Challenge: Using Objects for Lookups
Link to the challenge: