JavaScript Algorithm Walkthrough — Selection sort sorts an array by locating the element with the smallest value and placing it at the beginning of the array. let theFirst = [3, 4, 56, 43, 8, 99] function select(arr){
let swap = (array, i1, i2) => ([arr[i1], arr[i2]]= [arr[i2], arr[i1]])
let min
for(let…