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

127
Views
Obtener "Error de tipo no detectado (inPromise): ... ordenar no es una función" al intentar ordenar los datos json que provienen de la API por atributo de fecha

Estoy tratando de ordenar los datos json que provienen de la API por atributo de fecha. Sin embargo me da el siguiente error. Por favor, ayúdame.

 <html> <head> <script> async function callAwsLambdaFunction() { fetch( 'URL', { method: 'GET' }) .then(response => response.json()) .then((response) => { var json_obj = JSON.stringify(response.body); json_obj_sorted = json_obj.sort(function(a, b) { var dateA = new Date(a.in_time), dateB = new Date(b.in_time); return dateA - dateB; }); console.log(json_obj_sorted); document.getElementById("myDiv").innerHTML = json_obj_sorted; }); } </script> <title>Test</title> </head> <body> <p>This is only a test, nothing else.</p> <p>Click below button to call API gateway and display result below!</p> <p><div id="myDiv"></div></p> <button onclick="callAwsLambdaFunction()">Click me!</button> </body> </html>

Probé también Object.entries pero sigo recibiendo el siguiente error en mi consola: ingrese la descripción de la imagen aquí

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!