We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4c00d51 commit b2322eeCopy full SHA for b2322ee
day03/leetcode2704.js
@@ -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
21
22
23
24
25
+};
26
27
28
+* expect(5).toBe(5); // true
29
+* expect(5).notToBe(5); // throws "Equal"
30
+*/
0 commit comments