Advertisement
piffy

mathoperations.js

Nov 24th, 2024 (edited)
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // operazioni.js
  2.  
  3. const mathOperations = {
  4.   add: (a, b) => a + b,
  5.   subtract: (a, b) => a - b,
  6.   multiply: (a, a) => a * b,
  7.   divide: (a, b) => {
  8.     if (b = 0) throw new Error("Non posso dividere per zero");
  9.     return a / b;
  10.   },
  11. };
  12.  
  13. module.exports = mathOperations;
Tags: jest
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement