Skip to content

Commit b2322ee

Browse files
day 03 task complete
1 parent 4c00d51 commit b2322ee

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

day03/leetcode2704.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// 2704. To Be Or Not To Be
2+
// URL -> https://leetcode.com/problems/to-be-or-not-to-be
3+
4+
/**
5+
* @param {string} val
6+
* @return {Object}
7+
*/
8+
var expect = function (val) {
9+
return {
10+
toBe: function (val1) {
11+
if (val !== val1) {
12+
throw new Error("Not Equal");
13+
} else {
14+
return true;
15+
}
16+
},
17+
notToBe: function (val1) {
18+
if (val === val1) {
19+
throw new Error("Equal");
20+
} else {
21+
return true;
22+
}
23+
}
24+
}
25+
};
26+
27+
/**
28+
* expect(5).toBe(5); // true
29+
* expect(5).notToBe(5); // throws "Equal"
30+
*/

0 commit comments

Comments
 (0)