Fill the first half of the final array with reversed sequence
let left = n - 1 ; for ( let i = 0 ; i < parseInt ( n / 2 , 10 ) + 1 ; ++ i ) { b [ i ] = arr [ left ] ; left = left - 2 ; if ( left < 0 ) break ; }