My array contains the following mock data:
export class Task {
id: number;
title: string;
state: number;
priority: number;
describtion: string;
}
There are multiple entries in this array, each with a priority ranging from 1 to 5.
What is the best way to sort this array by its priority in ascending order?