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.
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.
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
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.