Recursively call for the list less than the last element and and return the newly formed list
let pass = [ ] ; for ( let i = 0 ; i < res . length - 1 ; i ++ ) pass . push ( res [ i ] ) ; let ans = bubble_sort ( pass ) ; ans . push ( res [ res . length - 1 ] ) ; return ans ; }