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

307
Views
¿Cómo reescribiría el código de Brad para usar el método de división y qué error hay en el código?

Estoy tratando de aprender JavaScript y actualmente tengo una pregunta sobre cómo volvería a escribir el código de brad usando el método de división y el error que brad tiene en su código. ¿Puedes ayudarme? Aquí está el código

 function validate(phoneNumber) { if (phoneNumber.length > 8 || phoneNumber.length < 7) { return false; } var first = phoneNumber.substring(0,3); var second = phoneNumber.substring(phoneNumber.length - 4); if (isNaN(first) || isNaN(second)) { return false; } if (phoneNumber.length === 8) { return (phoneNumber.charAt(3) === "-"); } return true;

}

 var number= validate("123-6778"); console.log(number);

Pagina la pregunta y el código está en

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!