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
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...
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).](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F22884497-b1d7-4567-a7ea-0174c1c4ee01%2F2b2e06dc-63b8-44c4-92ac-bc5f91029a93%2Fvr2i5if_processed.png&w=3840&q=75)
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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 6 images

Recommended textbooks for you

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 Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

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 Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

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
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education

Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY