I have an exercise that consists of using functional programming using javascript, the exercise is to make a calculator, I already did the multiplication without using recursion or the / operator but I don't understand how to do the division, I have tried various solutions but it doesn't work.
My operations
const adition = (a, b) => a + b;
const sustraction = (a, b) => a - b;
const multiplication = (a, b) => {
return [...Array(b)].reduce((acc) => adition(acc, a), 0);
};
Remember how you did long division in grade school?
Implement that! 😉
But if you can't remember: