Question: Question 2 Write a function in JavaScript that will return the sum of the longest streak of consecutive increasing numbers within an array. If there

Question 2 Write a function in JavaScript that will return the sum of the longest streak of consecutive increasing numbers within an array. If there are no consecutive numbers in the array, the function will return zero. If there are multiple instances of the same number of consecutive numbers (increasing by 1) in the array, the function will return the largest sum calculated between all instances. Examples: o [1, 2, 3, 6, 9, 34, 2, 6] would return 6 (1+2+3) [3, 2, 7, 5, 6, 7, 3, 8, 9, 10, 23, 2, 1, 2, 3] would return 27 (8+9+10) o [100, 101, 102, 3, 4, 5, 6, 9] would return 18 (3+4+5+6)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
