function sortArray(x,y)
{
return ((x[1] < y[1]) ? -1 : ((x[1] > y[1]) ? 1 : 0));
}
var givenarr = [[0,8],[1,9],[2,7]];
givenarr.sort(sortArray);
========================
The result array will be givenarr = [[2,7],[0,8],[1,9]];
function sortArray(x,y)
{
return ((x[1] < y[1]) ? -1 : ((x[1] > y[1]) ? 1 : 0));
}
var givenarr = [[0,8],[1,9],[2,7]];
givenarr.sort(sortArray);
========================
The result array will be givenarr = [[2,7],[0,8],[1,9]];
Turn insight into action
If this article sparked an idea, question, or project direction, I can help you turn it into a practical next step.
Most recent
For many technical leads and developers, the leap from shipping code to managing a business can feel daunting. However, the rise of sophisticated agentic workflows has changed the landscape for the solo entrepreneur. By building a robust AI automation backbone, you can transition from a developer to a founder who manag
Read articleBefore diving into job boards or technical certifications, take a moment to evaluate your intrinsic motivators. Career satisfaction is rarely driven by a single factor; it is typically the intersection of your strengths, your interests, and your values.
Read articleThe migration is not only about moving posts. URLs, assets, authors, metadata and redirects all protect long-term search value.
Read article