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

137
Views
Quiero saber qué significa esta línea de código: /[a-zA-Z]/

Quiero mover el primer carácter de una cadena al final y luego agregarle "ay", traté de resolverlo pero no pude y luego encontré esta solución. ¿Puedes explicarme la lógica en este código?

 function pigIt(str){ str = str.split(' '); for(let i = 0;i<str.length;i++){ if(/[a-zA-Z]/.test(str[i])){ str[i] = str[i].slice(1) + str[i][0] + 'ay'; } } return str.join(' '); } console.log(pigIt('Pig latin is cool'));

about 4 years ago · Santiago Gelvez
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!