I need to sort list of items by its priority(ascending order) ?
var priorityIssuesList = [
{ name: "Danger", status: "RED", priority:4},
{ name: "Moderate", status: "BLUE", priority:2},
{ name: "Safe", status: "GREEN",priority:1},
{name: "Warning", status: "Yellow",priority:3}
]
sorting should be in ascending order or status
[
{"name":"Safe","status":"GREEN","priority":1},
{"name":"Moderate","status":"BLUE","priority":2},
{"name":"Warning","status":"Yellow","priority":3},
{"name":"Danger","status":"RED","priority":4}
]
what is the best way to do this?