Skip to content
⌘K
Explore
Download
Docs
Sign in
Sign up
flagon-io
/
automation-lab
public
Star
0
Overview
Code
Issues
1
Pull requests
Workflows
Deployments
Insights
Files
Commits
Branches
Tags
Releases
Compare
Commit
Merge #3: Add multiply to math.js
g1t
bot
committed
1w ago
Parents
ca04be3
70aad60
Browse files
110cb1268f67
2
files
+8
−2
0/2 viewed
Files
Collapse all
Unified
Split
math.js
+7
−1
View
Blame
Viewed
1
1
// Small helpers for numbers.
2
+
/** Returns the sum of a and b. */
2
3
function add(a, b) {
3
4
return a + b;
4
5
}
5
6
6
−
module.exports = { add };
7
+
/** Returns the product of a and b. */
8
+
function multiply(a, b) {
9
+
return a * b;
10
+
}
11
+
12
+
module.exports = { add, multiply };
test.js
+1
−1
View
Blame
Viewed
2
2
const math = require("./math");
3
3
4
4
assert.strictEqual(math.add(2, 3), 5);
5
−
if (math.multiply) assert.strictEqual(math.multiply(4, 5), 20);
5
+
assert.strictEqual(math.multiply(4, 5), 20);
6
6
console.log("all tests passed");
Merged in
Add multiply to math.js
#3
written by g1t
Why it was written