Exercise 2: Calculator
Explore how to build a Calculator object in JavaScript using a constructor function. Learn to add essential methods like add, subtract, multiply, and divide to carry out arithmetic operations on object properties. This exercise reinforces understanding of object creation and method definition with prototypes.
We'll cover the following...
We'll cover the following...
Problem Statement
A constructor function called Calculator is given with fields: num1 and num2. You have to add the following methods to the constructor ...