diff options
author | terminaldweller <devi@terminaldweller.com> | 2024-01-05 21:38:23 +0000 |
---|---|---|
committer | terminaldweller <devi@terminaldweller.com> | 2024-01-05 21:38:23 +0000 |
commit | ff85091160af4613c0493ab1524196c649ab9e7f (patch) | |
tree | 4e86acaaea1b21c28dbf5351d19c1b3355086935 /2666/main.js | |
parent | 2703 (diff) | |
download | leetcode-ff85091160af4613c0493ab1524196c649ab9e7f.tar.gz leetcode-ff85091160af4613c0493ab1524196c649ab9e7f.zip |
2666
Diffstat (limited to '2666/main.js')
-rwxr-xr-x | 2666/main.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/2666/main.js b/2666/main.js new file mode 100755 index 0000000..8211bb7 --- /dev/null +++ b/2666/main.js @@ -0,0 +1,12 @@ +#!/usr/bin/env node +var once = function (fn) { + var called = false; + return function (...args) { + if (called) { + return undefined; + } else { + called = true; + return fn(...args); + } + }; +}; |