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

121
Views
Sort function doesn't work on objects array IE 10

I am trying to sort objects array per "date" property. This works fine in chrome, but in IE doesn't (PSB example 1).

I have tried sorting simple dates array and it works fine(example 2), only when the array is made of objects it doesn't.

Any idea why?

example 1 - doesn't work:

let objectsArr = [
  { dd: { name: 'l', address: 'dd' }, ww: { age: 15, city: 'BB' }, date: '12/03/2025' },
  { dd: { name: 'l', address: 'dd' }, ww: { age: 15, city: 'BB' }, date: '12/05/2025' },
  { dd: { name: 'l', address: 'dd' }, ww: { age: 15, city: 'BB' }, date: '12/03/2025' },
  { dd: { name: 'l', address: 'dd' }, ww: { age: 15, city: 'BB' }, date: '12/03/2015' },
  { dd: { name: 'l', address: 'dd' }, ww: { age: 15, city: 'BB' }, date: '10/03/2025' },
  { dd: { name: 'l', address: 'dd' }, ww: { age: 15, city: 'BB' }, date: '12/03/2029' },
  { dd: { name: 'l', address: 'dd' }, ww: { age: 15, city: 'BB' }, date: '12/03/2025' },
  { dd: { name: 'l', address: 'dd' }, ww: { age: 15, city: 'BB' }, date: '12/03/2005' },
];
objectsArr = objectsArr.sort(function (a, b) {
  return Date.parse(a.date) - Date.parse(b.date);
});

example 2 - works OK:

let datesArr = [
  '12/03/2025',
  '12/03/2021',
  '12/03/2020',
  '12/03/2021',
  '12/03/2019',
  '12/03/2023',
  '12/03/2011',
  '12/03/2016',
];
datesArr = datesArr.sort(function (a, b) {
  return Date.parse(a) - Date.parse(b);
});
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!