Skip to content

sf-wdi-24/functions-challenges

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 

Repository files navigation

Functions Challenges

Evening challenges for the functions module.

Maxormin(num1, num2, max)

Define a function maxOrMin that takes three parameters: two numbers and a boolean. Have it return the larger of the two numbers if the boolean is true, otherwise have it return the lesser of the numbers.

sillySum(arr)

Write a function that takes an array of numbers and returns the sum of each number multiplied by its index.

count += (number * index)

numSquare(max)

Create a function called numSquare that will return an array of all perfect square numbers up to, but not exceeding a max number.

isPrime(num)

Create a function that returns true if the number passed in is a prime number and false if not.

primes(max)

Using your isPrime function, create a function primes that will return an array of all prime numbers up to, but not exceeding a max number.

About

Evening challenges for WDI-24

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published