diff options
author | terminaldweller <devi@terminaldweller.com> | 2024-01-03 08:19:39 +0000 |
---|---|---|
committer | terminaldweller <devi@terminaldweller.com> | 2024-01-03 08:19:39 +0000 |
commit | 767f43ecf3f0331d51a63aacc28da70331c5dcf7 (patch) | |
tree | f8e075c68b0aa0674ef3b531b420ae6b4c63241b /2704/main.js | |
parent | 2125 (diff) | |
download | leetcode-767f43ecf3f0331d51a63aacc28da70331c5dcf7.tar.gz leetcode-767f43ecf3f0331d51a63aacc28da70331c5dcf7.zip |
2704
Diffstat (limited to '2704/main.js')
-rwxr-xr-x | 2704/main.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/2704/main.js b/2704/main.js new file mode 100755 index 0000000..db4d727 --- /dev/null +++ b/2704/main.js @@ -0,0 +1,25 @@ +#!/usr/bin/env node +"use strict"; + +var expect = function (val) { + var object = { + toBe: function (except) { + if (except === val) { + return true; + } else { + throw "Not Equal"; + } + }, + notToBe: function (except) { + if (except !== val) { + return true; + } else { + throw "Equal"; + } + }, + }; + return object; +}; + +console.log(expect(5).toBe(5)); // true +console.log(expect(5).notToBe(5)); // throws "Equal" |