DEV Community

Cover image for JavaScript Tutorial Series: practice 2
The daily developer
The daily developer

Posted on • Updated on

JavaScript Tutorial Series: practice 2

In this post you're going to solve a couple of exercises test your previously acquired knowledge.

Exercise 1

Create a function that receives an array of numbers as input and outputs the average of those numbers. To implement the function, use the / operator, an arrow function, and a higher order function.

Exercise 2

Create a function that accepts an array and a value as arguments and outputs a boolean indicating whether the array contains the value or not.

Exercise 3

Make a function that takes a list of numbers as input and returns a new list with each element in the first list squared.

Exercise 4

Create a book object that includes the properties of author, title, and number of pages. Afterwards, create a function that accepts that book object as input and logs a message to the console with the book's title, author, and page count.

Good luck !

Top comments (0)