I have an array that looks like the following
const files = ['30.png', '10.png', '1.jpeg', '2.jpeg', '12.gif', '4.png']
I wanna sort it in numerical order but just calling sort is a problem because when sorted it will look like this:
['1.jpeg', '10.png', '12.gif', '2.jpeg', '30.png', '4.png']
How can I sort it in a "correct" way so that it looks like this
[ '1.jpeg', '2.jpeg', '4.png', '10.png', '12.gif', '30.png']