Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial And Temporal Databases 8th International Symposium Sstd 2003 Santorini Island Greece July 2003 Proceedings Lncs 2750

Authors: Thanasis Hadzilacos ,Yannis Manolopoulos ,John F. Roddick ,Yannis Theodoridis

2003rd Edition

3540405356, 978-3540405351

More Books

Students also viewed these Databases questions