DEV Community

Cover image for How do we sort an Array in Javascript without Sort function?
Imran Shaik
Imran Shaik

Posted on

How do we sort an Array in Javascript without Sort function?

sorting an array without using the default javascript sort function.
There are multiple ways to sort an array in Javascript. one of the most popular is Bubble Sort

Problem - you have an array of integers, sort the array
Sorting can either be Ascending or descending.

const array = [-10, 15, 5, -1, 4, 7, -3]
Enter fullscreen mode Exit fullscreen mode

consider

Top comments (0)