How do i use the .sort(); methode with an array to make it so that the elements inside are sorted from least to greatest?… they are all numbers from 2 through 14.
And when you look at that in the browser it gives you this:
2,3,4,5,7,9,10,11,12,13,14
What I did was included a "compare function" for the sort method. What it does is tells the method how to sort the items in the array. If you want to know more you can read about it here: