How to sort an array using sort() method in JavaScript?

How to sort an array using sort() method in JavaScript?

More to explore

Based on this image's title: “How to sort an array using sort() method in JavaScript?