a. Create a function that will count the number of even numbers contained in the array that is passed to this function. The array may contain values of any type, but you only count the even numbers. This function will return a number (number of instances of even numbers found in array). Needless to say, the function will return zero, if the array is empty or no even numbers are found. Note: The function does not display any output, nor it returns a string. Only the value of your counter is returned. p. Call your function at least three times, passing array with different content and display a message for each call, as shown in example below. Display each result as a separate h2 elements inside the div element (created in your HTML): let evenNums = countEvenNumbers([ , 33, 4, “Hi", 5, 66, “no"]); %3D

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Using functions right this code with javascript

Use our HTML template to create a file named as your name (for example if your name is john the file
name would be "john.html"). Make sure to update the meta data (title, author, description.)
accordingly. This HTML file should contain an h1 heading element that includes your full name and
student number.
. Create an empty <div> element with an id of your name. This element should be used to display your
output from JavaScript.
Create a JavaScript file named as your studentid.js that performs following:
a. Create a function that will count the number of even numbers contained in the array that is passed
to this function. The array may contain values of any type, but you only count the even numbers.
This function will return a number (number of instances of even numbers found in array). Needless
to say, the function will return zero, if the array is empty or no even numbers are found.
Note: The function does not display any output, nor it returns a string. Only the value of your
counter is returned.
b. Call your function at least three times, passing array with different content and display a message
for each call, as shown in example below. Display each result as a separate h2 elements inside the
div element (created in your HTML):
let evenNums = countEvenNumbers([ , 33, 4, “Hi", 5, 66, “no"]);
Your output will be:
2 even numbers were found.
You will need to call your function two more times, passing an array that contains different values and
display result of those calls in a similar manner (as in example shown above).
Transcribed Image Text:Use our HTML template to create a file named as your name (for example if your name is john the file name would be "john.html"). Make sure to update the meta data (title, author, description.) accordingly. This HTML file should contain an h1 heading element that includes your full name and student number. . Create an empty <div> element with an id of your name. This element should be used to display your output from JavaScript. Create a JavaScript file named as your studentid.js that performs following: a. Create a function that will count the number of even numbers contained in the array that is passed to this function. The array may contain values of any type, but you only count the even numbers. This function will return a number (number of instances of even numbers found in array). Needless to say, the function will return zero, if the array is empty or no even numbers are found. Note: The function does not display any output, nor it returns a string. Only the value of your counter is returned. b. Call your function at least three times, passing array with different content and display a message for each call, as shown in example below. Display each result as a separate h2 elements inside the div element (created in your HTML): let evenNums = countEvenNumbers([ , 33, 4, “Hi", 5, 66, “no"]); Your output will be: 2 even numbers were found. You will need to call your function two more times, passing an array that contains different values and display result of those calls in a similar manner (as in example shown above).
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 6 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY