Learn: Bubble Sort in Javascript
Bubble Sort is the simplest sorting algorithm that repeatedly scrolls through the list, compares adjacent elements and swaps them if they are in the wrong order. This sort is not used in real-world project because is very performs poorly.
Fast example
We start with an array, not sorted, composed like this: [8,5,2,6,12]
The algorithm consists in cycling the array, checking…