OBJECTIVE: Work with arrays and iterative code
REQUIREMENTS
Write an HTML page styled with basic CSS that includes a Javascript with the following characteristics:
Includes these three variables, updating the targetName value to match your first name:
const arrayOfNumbers = [4, 0, -4, 13, -2];
const students = [“Jane”,”Joe”,”Jack”,”Jill”,”Jerome”];
const targetName = “Jill”; //change “Jill” to your first name
PART ONE
Use an array. push() to add three more first names to the student’s array. One of those three names should
be your first name.
Display the total number of students in the array. Iterate over the student’s array and display each student name as a LI tag in a UL
If the student name matches the target name include a ‘target found’ message along with the student name in the LI tag.
After displaying the student array, provide a message that summarizes whether the target name was or was not found in the array.
To test your script thoroughly, change the value of the target name so that it sometimes does match a student in the array, and sometimes it does not.
PART TWO
Use iterative code to display each of the numbers in the array of numbers array, and then perform a count down or count up from that number to zero. For example, if the number is 4, display 4 3 2 1 0. If
the number is -3 display -3 -2 -1 0. If the number is 0, display a message saying there is no counting to be done.