Function to sort the array
function variationStalinsort ( arr ) { let j = 0 ; while ( true ) { let moved = 0 ; for ( let i = 0 ; i < ( arr . length - 1 - j ) ; i ++ ) { if ( arr [ i ] > arr [ i + 1 ] ) {