To get the middle of an array you could just try accessing array[size/2]. If size is not even and you want to be sure to get the 'lowest' half or the 'highest' half. You could use the function ceil (The ceil() method rounds a number UP to the nearest integer) and floor (The floor() method rounds a number DOWN to the nearest integer) to access array[Math.floor(size/2)] or array[Math.ceil(size/2)]