Arrays and For Loops

Complete each exercise shown on the HTML by adding code to the JS file associated with this project.


Question 1

Given the array defined as

                    
                       var arr = [2, 5, 8, 10, 16, 7, 8]
                    
                

Write a function called outputEvens that will display the even index values.


Question 2

Given the array defined as

                    
                       var shapes = ["Circle", "Square", "Rectangle", "Trapezoid","Triangle", "Rhombus", "Octagon"]
                    
                

Write a function called listElements that accepts a number 'n' as a parameter and displays 'n' number of elements from the beginning of the array.
Demonstrate the function by using the input box as the number of elements to display.




Question 3

Write a function arrayFill which accepts input from the box, adds it to an array, then outputs the array. An example output might look like:
Orange
Orange, Yellow
Orange, Yellow, Green




Question 4

Using arr and shapes create a function called pairingArrays which creates the following output:
"I drew 2 Circles"
"I drew 5 Squares"
"I drew 6 Rectangles"
...
"I drew 8 Octagons"



When you have finished these exercises, upload the project to your github and link it in your projects table.