I need help to figure out why my code does not work in Javascript

// Setup 
function phoneticLookup(val) {
  let result = "";

  // Only change code below this line
  val lookup = {
    "alpha": "Adams", 
    "bravo": "Boston",
    "charlie": "Chicago", 
    "delta": "Denver", 
    "echo": "Easy",
    "foxtrot": "Frank"
  result = lookup[val];

  // Only change code above this line
  return result;


Heres The link to the question I was trying to answer with that code above. Basic JavaScript: Using Objects for Lookups | freeCodeCamp.orgLink to the question I was trying to answer with my code posted.

Can you be more specific about what is going wrong?

You should be getting an error because of this line

way does. val lookup = { in my code bring out a error in my code in how do I fix it.

Is val the keyword to declare a variable? You are looking for let or const

way does. val lookup = {

in my code bring out a error in my code, in how do I fix it.

Convert the switch statement into an object called lookup. Use it to look up val and assign the associated string to the result variable. Thats what the task says do so I think so.

Did you read what I wrote? I told you what is wrong with it.

You cannot use val to declare a variable.

This doesn’t say to use val as a variable declaration keyword. Using val in that way is not valid code.

can you show me because I don’t know.

I suggest you go back in the Basic section a little to review how to declare variables.

You need to use a different keyword to declare the variable named lookup which is being assigned an object.

val is a variable and not a keyword. @JeremyLT Gave you a hint of which keywords you can use.

I will let you know if that work or not when try it out.

I just change val to const. It work I will be putting this in my notes.

In the instruction video val was used to declare a variable that was a object in it work. Can that be explained?

What video are you talking about?

Tips on how you were able to Rember The basics please.

Please post a link to the video.

Just keep practicing writing code. Repetition is the key. If you are struggling with a challenge, then back up a few challenges and redo them. You can reset the code for any challenge and rework it from scratch.

I miss read the video it was not val as I thought it was var.