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

221
Vistas
Liver server freezes when looping over an array elements

I am trying to check whether the value in the input includes any numbers if so check whether the value includes any symbols as well. If not text.Content = "Your password should have symbols and numbers". This function runs when I click a specific button, however every time the button is clicked the live server freezes. Can you help me solving the problem and make it the code run properly. I know somewhere in the code return should be included, but I am relatively new to JS and I am not sure exactly where.

JS:

let error
for(let i = 0; i < numbers.length; i++){

    if(signInPassword.value == ""){
        error = "Fill in the field!"
    } else if(signInPassword.value.length < 4){
        error = `Your password should have at least 4 characters`
    } else if(signInPassword.value.includes(numbers[i])){

        for(let x = 0; x < symbols.length; i++){
            if(signInPassword.value.includes(symbols[x])){
                error = "matches"
            } else {
                error = `Your password should have symbols and numbers`
            }
        }
    } else{
        error = `Your password should have symbols and numbers`
    }
    pErr.textContent = error
}
about 4 years ago · Juan Pablo Isaza
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