JAVACRIPT Code Function to Sort Numbers Numerically
One Line JS Code to Sort Numbers Numerically so [12, 5, -12, 4, 556, 99] Becomes [-12, 4, 5, 12, 99, 556]
Home
Short:
This simple line of code will take a list of numbers and sort them in numerical order.
[12, 5, -12, 4, 556, 99].sort((a,b)=>a-b)
source code home