Arrow functions in JavaScript
Easy
29
77.9% Acceptance
In this hands-on lab, you will practice using arrow functions in JavaScript. Arrow functions offer a simpler syntax than regular functions and have some additional benefits like lexical this
scoping. Your task is to create four arrow functions with specific functionality.
- Create an 'add' function that takes two parameters and returns their sum.
- Create a 'multiply' function that takes two parameters and returns their product.
- Create an 'isEven' function that evaluates if a number is even or not.
- Create a 'square' function that computes the square of a single parameter.
Be sure to export your arrow functions to be evaluated correctly.