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

182
Views
Mapeo sobre una matriz: el retorno del mapa no está definido

Todavía soy bastante nuevo en JS y no entiendo por qué esta función no está definida. ¿Qué no estoy viendo?

 const people = [ { name: 'Ben', year: 1980 }, { name: 'John', year: 1985 }, { name: 'Bob', year: 1971 } ];

y mi función:

 const myFunction = () => { people.map((person) => { return person.year; }); }; console.log(myFunction());

gracias a todos

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

0

 const people = [{ name: 'Ben', year: 1980 }, { name: 'John', year: 1985 }, { name: 'Bob', year: 1971 } ]; const myFunction = () => { const newPeople = people.map((person) => { return person.year; }); return newPeople; }; console.log(myFunction());

necesita devolver el valor que desea que se devuelva

ahora la salida es la siguiente:

 [1980, 1985, 1971]
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!