Skip to content

Instantly share code, notes, and snippets.

@thunder775
Created January 10, 2020 03:30
Show Gist options
  • Save thunder775/a36813d4c593f7286ef4b337b5ad0eae to your computer and use it in GitHub Desktop.
Save thunder775/a36813d4c593f7286ef4b337b5ad0eae to your computer and use it in GitHub Desktop.
let sortingList = function(list){
let j = 0;
for(var i = 0;i<list.length;i++){
var max_of_array = Math.max.apply(Math, list.slice(j,list.length));
list[j]=max_of_array
var index = list.indexOf(max_of_array)
list.splice(index,1)
j++
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment