- Clone down this assignment to your `code-challenges' directory in AWS Cloud9.
- Code your solution using JavaScript in
index.js
. - Be sure to run and test your code throughly!
- By the end of Code Challenge, commit and push your changes up to Github.
- Using the browser, verify that your solution is in your remote repo on Github.
-
Write a function named
countToTen
that console.logs all the integers from 1 to 10. -
Write a function named
countFromOne
that takes in an integer argument, and console.logs all the integers from 1 up to the given integer. -
Write a function named
countEveryEven
that takes in an integer argument, and console.logs all the even integers from 1 up to the given integer, including the given integer.
countEveryEven(10) // logs 2 4 6 8 10
- Write a function named
countEveryOdd
that takes in an integer argument, and console.logs all the odd integers from 1 up to the given integer, including the given integer.
countEveryOdd(10) // logs 1 3 5 7 9
- Write a fucntion named
countEvens
that takes in an array of integers and returns the number of integers in the array that are even numbers.
countEven([1,2,3,4,5,6,7,8,9,12]) // returns 5
countEven([1,2,22,204]) // returns 3
countEven([1,3,7,17,19]) // returns 0