Foro de elhacker.net

Programación => Scripting => Mensaje iniciado por: behindfa21 en 25 Octubre 2022, 06:42 am



Título: Duda con codigo javascript
Publicado por: behindfa21 en 25 Octubre 2022, 06:42 am
Hola, una pregunta, alguien me podría explicar esta estructura de codigo

Código
  1. var id
  2.    contactList.length != 0 ? contactList.findLast((item) => id = item.id) : id = 0
  3.  
  4.    if(document.getElementById('id').value){
  5.  
  6.        contactList.forEach(value => {
  7.            if(document.getElementById('id').value == value.id){
  8.                value.Nombre      = document.getElementById('Nombre').value,
  9.                value.Edad       = document.getElementById('Edad').value,
  10.                value.FechaNacimiento   = document.getElementById('FechaNacimiento').value,
  11.                value.Sexo       = document.getElementById('Sexo').value,
  12.                value.Teléfono     = document.getElementById('Teléfono').value
  13.            }
  14.        });
  15.  
  16.        document.getElementById('id').value = ''

Muchas gracias!!