Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started