Skip to content
Advertisement

Order Array of objects by two fields , date and order

i need order and array of objects by two fields :

1- date, closests to today

2- order (10 maximun and 0 minimun) ASC

i use usort for order by date :

JavaScript

but i can’t with the field order ASC any idea please ?

Advertisement

Answer

JavaScript

Output:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement