Menu
Imagine we were building a to-do list application in JavaScript and you want to display the tasks in the order that they were added to the list. However, you also want to give the user the option to sort the tasks by priority level (low, medium, high). The priority level is stored as a string property in each task object in the array. In order to sort the tasks by priority level, we would need to sort the array of task objects by the string property value of the “priority” property.