Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

214
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!