Question: Language: JAVASCRIPT & HTML ANSWER IN CODE ONLY! Create a function that takes in 3 inputs - isEven (boolean), isHighest (boolean), numbers (array of numbers)

Language: JAVASCRIPT & HTML

ANSWER IN CODE ONLY!

Create a function that takes in 3 inputs - isEven (boolean), isHighest (boolean), numbers (array of numbers)

Given the array below, the function will find the highest/lowest even/odd number in the array.

[22,14,2,5,75,46,6,3]

ie. isEven=true, isHighest=false will yield 2

isEven=false, isHighest=true will yield 75

function findTheNumber(isEven, isHighest, numbers) { // Write your algorithm here return 0 }

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!