added tests
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
console.log("Hello, World!");
|
||||
|
||||
const calculator = {
|
||||
add: (a, b) => a + b,
|
||||
subtract: (a, b) => a - b,
|
||||
multiply: (a, b) => a * b,
|
||||
divide: (a, b) => {
|
||||
if (b === 0) {
|
||||
throw new Error("Cannot divide by zero");
|
||||
}
|
||||
return a / b;
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = calculator;
|
||||
Reference in New Issue
Block a user