Skip to content

Commit

Add subtract to math.js

g1tbot and Claudeagentcommitted Parent1eadc99Browse files
2 files+7−00/2 viewed
+6−0
44 }
55
66 module.exports = { add };
7+
8+function subtract(a, b) {
9+ return a - b;
10+}
11+
12+module.exports.subtract = subtract;
+1−0
11 const assert = require("node:assert");
22 const math = require("./math");
3+assert.strictEqual(math.subtract(5, 3), 2);
34
45 assert.strictEqual(math.add(2, 3), 5);
56 if (math.multiply) assert.strictEqual(math.multiply(4, 5), 20);

Comments

Sign in to comment.