Write a function named customArraySort that receives 2 parameters:
an Array of objects, each with 2 properties:
id: stringage: numbercurrentUserId: string
The function should return a new array that contains all elements, but sorted in a special order:
Inside every interval, the users are sorted descending by age.
users
=currentUserId
=Unlock all functions
The first 10 functions are free. Get lifetime access to all 100 with a one-time payment — no subscription.
Upgrade to Pro