returning two middle values java script array code example
Example 1: javascript middle of array
var arr = [1,2,3,4,5];
return arr[Math.floor(arr.length/2)];
Example 2: javascript function multiple return
function doubleEachElement(num1, num2) {
return [num1 * 2, num2 * 2];
}
const [a, b] = doubleEachElement(68, 100);