i'm trying to find a solution to this exercise:
Implement the calculate function that adds an object that gives the ability to do the four mathematical operations (addition, subtraction, multiplication and division) on the same number and finally print out the result.
function calculate() {
}
const calculator = calculate();
calculator.add(2).add(4).multiply(3).sub(1).sub(3).divide(2).printResult(); // result will be: 7
console.log(calculator)
so, what is the right way to solve this (and if you can add comment will be appreciated