JSFiddle - React, Tailwind, and code Playground

by Fabio Dan

JavaScript

function bubbleSort(items) {
	const length = items.length
  var swapped = false
  
  do {
  	
    for (let i = 0; i < length; i++) {
	    console.log(123)
    	swaped = true
    }
  } while (swapped === false)
}

bubbleSort([5,4,3,2,1])