Write a function maxAdjacentProduct(numbers) that returns the largest product of two neighbor elements of an array.
numbers is an array of integers. They can be positive, negative or 0.i and i + 1. Multiply every such pair and return the largest product as a number.-5 * -6 is 30.-2.maxAdjacentProduct([3, 6, -2, -5, 7, 3])Returns 21
maxAdjacentProduct([-5, -6, 1])Returns 30
maxAdjacentProduct([5])Returns null
Asked at Amazon · Source
maxAdjacentProduct([ 3, 6, -2, -5, 7, 3 ])21maxAdjacentProduct([ 1, 2, 3 ])6maxAdjacentProduct([ 5 ])nullHidden tests run on Submit.