Answers for "how to return the middle of an array in javascript"

3

javascript middle of array

var arr = [1,2,3,4,5];

return arr[Math.floor(arr.length/2)];
Posted by: Guest on June-18-2020

Code answers related to "how to return the middle of an array in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language