Answers for "sort object with certain value at start of array js"

0

sort object with certain value at start of array js

objs.sort((a,b) => {
 	if (a.value == "your value") return parseInt("-" + objs.indexOf(a)) // moves up based on its index
})
Posted by: Guest on July-22-2021

Code answers related to "sort object with certain value at start of array js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language