Script to sort an array of objects in an specific way.
- or -
Post a project like this2100
€35(approx. $38)
- Posted:
- Proposals: 4
- Remote
- #2056483
- PRE-FUNDED
- Awarded
Description
Experience Level: Intermediate
Estimated project duration: 1 day or less
I have an array with the shape in mockArr.js, I need to sort the elements of the array using the property `category`, so the result it's sorted alphabetically by `name` and alternates elements of different `category`, in the order that I specify.
I would requiere a function in JavaScript, (NOT JQUERY) where I'm passing the array of elements and the array of the order I want to follow:
`function sortArray(mockProduct, orderArray)`
I'm attaching 3 files:
- an example of the array to sort, (mockProduct,js)
- the result I would like (mockResult.js)
- the parameter to pass in the function (orderArray.js).
I would requiere a function in JavaScript, (NOT JQUERY) where I'm passing the array of elements and the array of the order I want to follow:
`function sortArray(mockProduct, orderArray)`
I'm attaching 3 files:
- an example of the array to sort, (mockProduct,js)
- the result I would like (mockResult.js)
- the parameter to pass in the function (orderArray.js).
JC G.
100% (6)Projects Completed
4
Freelancers worked with
6
Projects awarded
100%
Last project
27 Jun 2018
Spain
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
Hi
Is this still available?
665490
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies