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

334
Views
regex exec es la primera vez, diga == cierto, entonces me está dando un problema nulo no es nulo

 function findSimilarity(str, word) { const reg = /(^.)(.*)(.$)/g; word = reg.exec(word); const findSpaceRegex = /([^ ]+)/g; str = str.match(findSpaceRegex); return str.map((e) => { if ( reg.exec(word)[1] == reg.exec(e)[1] && reg.exec(word)[2].length == reg.exec(e)[2].length && reg.exec(word)[0] != reg.exec(e)[0] && reg.exec(word)[3] == reg.exec(e)[3] ) console.log(true); }); } console.log(findSimilarity("bag dog dig dot doog dogs", "dog"));

este es mi código y cuando trato de resolver este https://www.codewars.com/kata/573975d3ac3eec695b0013e0/train/javascript kata, uso exec pero el problema es que exec funciona solo una vez. que cuando quiero ejecutarlos a todos, dice nulo, pero el problema no es nulo. cuando digo a.match(Regex) funciona bien pero no necesita mis necesidades. Entonces, ¿cuál es mi problema o cuál es el problema del mapa? Quiero agradecer a la derecha saber por responder a la pregunta.

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!