Skip to content

Commit

Permalink
Time: 49 ms (74.88%) | Memory: 48.6 MB (83.60%) - LeetSync
Browse files Browse the repository at this point in the history
  • Loading branch information
nitesh2920 committed Jan 3, 2025
1 parent 028959a commit dd18f62
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions 2813-to-be-or-not-to-be/to-be-or-not-to-be.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* @param {string} val
* @return {Object}
*/
var expect = function (val) {
return {
toBe: (data) => {
if (val === data)
return true;
else {
throw new Error("Not Equal")
}
},
notToBe: (data2) => {
if (data2 !== val)
return true;
else {
throw new Error('Equal')
}
}
}


};

/**
* expect(5).toBe(5); // true
* expect(5).notToBe(5); // throws "Equal"
*/

0 comments on commit dd18f62

Please sign in to comment.