Convertir switch en objeto

function phoneticLookup(val) {
let result = “”;

// Cambia solo el código debajo de esta línea
const lookup = {
“alpha”: “Adams”,
“bravo”: “Boston”,
“charlie”: “Chicago”,
“delta”: “Denver”,
“echo”: “Easy”,
“foxtrot”: “Frank”
result = lookup[val]

// Cambia solo el código encima de esta línea
return result;


Please Tell us what’s happening in your own words.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more you say, the more we can help!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.