If N is odd keep left as arr [ n / 2 ] else keep left as arr [ n / 2 - 1 ] + 1 ;
var left ; if ( N % 2 == 1 ) { left = arr [ parseInt ( N / 2 ) ] ; } else { left = arr [ parseInt ( N / 2 ) - 1 ] + 1 ; }