aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorterminaldweller <devi@terminaldweller.com>2024-01-05 21:38:23 +0000
committerterminaldweller <devi@terminaldweller.com>2024-01-05 21:38:23 +0000
commitff85091160af4613c0493ab1524196c649ab9e7f (patch)
tree4e86acaaea1b21c28dbf5351d19c1b3355086935
parent2703 (diff)
downloadleetcode-ff85091160af4613c0493ab1524196c649ab9e7f.tar.gz
leetcode-ff85091160af4613c0493ab1524196c649ab9e7f.zip
2666
-rwxr-xr-x2666/main.js12
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);
+ }
+ };
+};