Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

169
Vistas
( if steatmetn), even if the value is null when I click the button it delete the items

in the if statement, even if the value is null, when I click the button, it is still deleting the item which is in the array. I would be happy if you guys help, I have no idea.

[1]:

here is the picture https://i.stack.imgur.com/0Pm5K.png

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

In first screenshot - you need to remove comparison with null, I mean next:

if(dele){
   ....
} else {
   alert('Put a value');
}

Solution for the second screenshot:

function myfc2() {
  let change = document.getElementById("den").value;

  if(change){
    liste[change] = document.getElementById("sen").value;
  } else {
    alert("Put a value");
  }

  document.getElementById("demo").innerHTML = liste;
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda