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

184
Views
¿Por qué no funciona mi devolución de llamada en la matriz?

Escribí el código para iterar a través de una matriz determinada y luego invoqué la función subtractTwo en cada elemento. Sin embargo, cuando ejecuto el mapa de funciones, el argumento de la matriz no cambia. ¿Alguien sabe por qué puede ser esto?

 // create the subtractTwo function, callback function function subtractTwo (number) { return number - 2; } // create higher-order function, map function map (array, callback) { // initiate a for loop, looping through the array and invoking the callback on each element; for (let i = 0; i < array.length; i ++) { callback(array[i]); } //return the new array return array; } //console.log(subtractTwo(4)); // Uncomment these to check your work! console.log(typeof subtractTwo); // should log: 'function' console.log(typeof map); // should log: 'function' console.log(map([3,4,5], subtractTwo)); // should log: [ 1, 2, 3 ]```
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!