JSFiddle - React, Tailwind, and code Playground
by MuLtDirectX
JavaScript
let a = [10, 2, 5, 1, 45, 4, 9]
let temp = 0
for (let i = 0; i < a.length; i++) {
for (let j = 0; j < a.length; j++){
if (a[i] < a[j]) {
temp = a[j]
a[j] = a[i]
a[i] = temp
}
}
}
console.log(a)