how to find the middle element of the array in javascript code example Example: javascript get middle of array var value = arr[arr.length / 2 | 0];