Please write this code in javascript and let me know if there is any issue Question: 1. 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 metadata (title, author, description...) accordingly. This HTML file should contain an h1 heading element that includes your full name and student number. 2. Create an empty element with an id of your name. This element should be used to display your output from JavaScript. 3. Create a JavaScript file named your studentid.js that performs the 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 the 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 does it return a string. Only the value of your counter is returned. b. Call your function at least three times, passing an array with different content, and display a message for each call, as shown in the example below. Display each result as a separate h2 element 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 displaying the results of those calls in a similar manner (as in the example shown above).
Instruction:
Please write this code in javascript and let me know if there is any issue
Question:
1. 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 metadata (title, author, description...) accordingly. This HTML file should contain an h1 heading element that includes your full name and student number.
2. Create an empty element with an id of your name. This element should be used to display your output from JavaScript.
3. Create a JavaScript file named your studentid.js that performs the 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 the 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 does it return a string. Only the value of your counter is returned.
b. Call your function at least three times, passing an array with different content, and display a message for each call, as shown in the example below. Display each result as a separate h2 element 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 displaying the results of those calls in a similar manner (as in the example shown above).
Step by step
Solved in 4 steps with 3 images