diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-07-13 15:35:52 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-07-13 15:35:52 +0200 |
commit | 6ea56ebf7e2ee9fc06423ae36ed3b852e7e80948 (patch) | |
tree | 3e0b2246175dfdb54669330c9f6653157b1329f4 /static/script.js | |
parent | Javascript use strict. (diff) | |
download | calp-6ea56ebf7e2ee9fc06423ae36ed3b852e7e80948.tar.gz calp-6ea56ebf7e2ee9fc06423ae36ed3b852e7e80948.tar.xz |
lol gensym.
Diffstat (limited to 'static/script.js')
-rw-r--r-- | static/script.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/static/script.js b/static/script.js index 58642b09..27831f35 100644 --- a/static/script.js +++ b/static/script.js @@ -33,11 +33,12 @@ function decimal_time_to_date (time, date) { } } -let gensym_counter = 0; -function gensym (prefix) { - gensym_counter++; - return prefix + gensym_counter; -} +/* if only there was such a thing as a let to wrap around my lambda... */ +let gensym = (function(counter) { + return function gensym (prefix="gensym") { + return prefix + ++counter; + } +})(0); /* start and end time for calendar page */ let start_time = new Date(); |