how to find the middle element in an array javascript code example
Example: javascript middle of array
var arr = [1,2,3,4,5];
return arr[Math.floor(arr.length/2)];
var arr = [1,2,3,4,5];
return arr[Math.floor(arr.length/2)];