JavaScript Reflect.set()

Hard
7
2
34.1% Acceptance

In this lab, you'll be using the Reflect.set() method from JavaScript. The Reflect.set() method is used to set properties of objects. Your task is to create a file named 'reflect.js', define and export a function named 'calculateArea' which takes two arguments (length and width) and calculates the area of a rectangle. Then, you will use the 'Reflect.set()' method to add a new property 'type' with the value 'rectangle' to the calculateArea function. It is a fundamental concept from JavaScript that needs to be practiced.