CC-04: For Loops and Conditionals
Last updated
Last updated
with Carmen Salas • 2024/10/08
yesterday's CC
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 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.
Write a function isNegative
that takes in a number parameter and returns true if the number is a negative value and false if the number is a positive value.
Write a function named betweenFiveAndTwenty
that takes in an integer parameter, and checks whether a given integer is within 5 and 20. It returns true
if it is and false
if not.
Write a function named sumOfThreeOrFive
that returns the sum of all the multiples of 3 or multiples of 5 from 1 to 1000, exclusive.
Write a function named isAllLowerCase
that takes in a string parameter, and returns true or false if the string consists of only lowercase letters.
Write a function named countMultiplesOfFive
that takes in an array of integers and returns the number of integers in the array that are multiples of five.