Question:
I have an array,productData
with multiple properties. This is how I currently sort the array by monthlyCost
, ascending.How can I modify this to sort all items by a boolean property
isPromoted
, followed by monthlyCost
?My array should start with all items where
isPromoted == true
sorted by monthlyCost
, then all items where isPromoted == false
sorted by monthlyCost
.+
.If you have better answer, please add a comment about this, thank you!