function adjacentElementsProduct(arr) { return Math.max(...arr.slice(0, -1).map((n, i) => n * arr[i + 1])) } console.log(adjacentElementsProduct([3, 6, -2, -5, 7, 3])); Run code snippet