from top to bottom , doing the same comparison as in the previous stage
for ( let i = end - 1 ; i >= start ; i -- ) { if ( a [ i ] > a [ i + 1 ] ) { let temp = a [ i ] ; a [ i ] = a [ i + 1 ] ; a [ i + 1 ] = temp ; swapped = true ; } }