There is an array containing elements with two properties each:
const players = [{id: 15, score: 567},
{id: 4, score: 789},
{id: 27, score: 123},
{id: 1, score: 654}];
The task at hand is to sort the array in ascending order based on the score property. The sorted result should be:
players = [{id: 27, score: 123},
{id: 15, score: 567},
{id: 1, score: 654},
{id: 4, score: 789}];