Print the new generated sorted array
for ( var i = 0 ; i < n ; i ++ ) document . write ( b [ i ] + " " ) ; } Array . prototype . insert = function ( index , item ) { this . splice ( index , 0 , item ) ; } ;