From ffca898a875caa66156b8525d517b87c9b9f5327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 26 Oct 2020 18:14:42 +0100 Subject: Cleanup and move input_list to own file. --- static/lib.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'static/lib.js') diff --git a/static/lib.js b/static/lib.js index 46236411..ab279353 100644 --- a/static/lib.js +++ b/static/lib.js @@ -12,6 +12,16 @@ HTMLElement.prototype.addEventListener = function (name, proc) { }; + +/* list of lists -> list of tuples */ +function zip(...args) { + // console.log(args); + if (args === []) return []; + return [...Array(Math.min(...args.map(x => x.length))).keys()] + .map((_, i) => args.map(lst => lst[i])); +} + + /* ----- Date Extensions ---------------------------- */ /* -- cgit v1.2.3