Practice on JavaScript functions

Задание 1

Create a function that takes a number as a parameter and returns an array of its divisors.

Задание 2

Create a function that takes two numbers as a parameter and returns an array of their common divisors.

Задание 3

Create a function that takes a number as a parameter and returns the sum of its digits.

Задание 4

Make a function that will return the current day of the week as a word.

Задание 5

Create a function that will receive a date as a parameter and return the day of the week as a word corresponding to this date.

Задание 6

Make a function that will take seconds as a parameter and return the number of days corresponding to these seconds.

Задание 7

Make a function that takes a year as a parameter and checks whether it is a leap year or not.

Задание 8

Make a function that takes a number as a parameter and checks whether it is prime or not.