Sort an Array of Objects by Boolean property in JavaScript | bobbyhadz
bobbyhadz.com · May 23, 2022
To sort an array of objects by a boolean property, call the `sort()` method on the array, passing it a function. In the function, convert the 2 boolean values to numbers and subtract the first number from the second.