Question: need help for this javaScript function, need to open with live server to check the answer, so just write the function is fun QUESTION 2

need help for this javaScript function, need to open with live server to check the answer, so just write the function is fun

need help for this javaScript function, need to open with live server

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) o [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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!