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

196
Views
Extraer un número dentro de una cadena y símbolos

tengo este codigo

 console.log({Stats:Object.fromEntries(['score','count','w','l','d'].map(s=>[s,teamsToPlay[0][s]]))})

// Estadísticas: { puntuación: 123 cuenta: 22 w: 12 l: 10 d: 0 }

¿Cómo puedo extraer el valor/número de cada entrada?

Lo intenté

 const d = ({Stats:Object.fromEntries(['d'].map(s=>[s,teamsToPlay[0][s]]))}).match(/\d+/);

pero da

{(valor intermedio)}.match no es una función

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Esta no es la mejor solución, pero funcionó para mí:

 var swin = {Stats: Object.fromEntries(['w'].map(s => [s, teamsToPlay[0][s]]))}; var scount = {Stats: Object.fromEntries(['count'].map(s => [s, teamsToPlay[0][s]]))}; swin = JSON.stringify(swin); scount = JSON.stringify(scount); swin = swin.match(/\d+/); scount = scount.match(/\d+/);
about 4 years ago · Juan Pablo Isaza Report
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!