Skip to content

Commit

Permalink
change function name 'pulsada'
Browse files Browse the repository at this point in the history
  • Loading branch information
conancos committed Apr 16, 2024
1 parent c051fdf commit b2138cd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,11 @@ $nav_container.addEventListener('click', (event) => {

const type = event.target.id;
console.log("Botón ID: ", type); //=> Por consola
const nombre_funcion = `btn_${type}`;
const pulsada = `btn_${type}`;

typeof btn_funciones[nombre_funcion] === 'function' ? btn_funciones[nombre_funcion]() : alert("Función del botón no encontrada", nombre_funcion);
typeof btn_funciones[pulsada] === 'function'
? btn_funciones[pulsada]()
: alert("Función del botón no encontrada", pulsada);
}
})

Expand Down

0 comments on commit b2138cd

Please sign in to comment.