From 1bc8b4885a95c6f50bae075b83ca9e5850f09a01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 12 Jul 2020 04:12:38 +0200 Subject: Add deleteIndex to javascript arrays. --- static/script.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/static/script.js b/static/script.js index 220451d9..0338cee5 100644 --- a/static/script.js +++ b/static/script.js @@ -1,3 +1,9 @@ +Array.prototype.deleteIndex = function(idx) { + if (idx != -1) { + this.splice(idx, 1); + } +} + /* -------------------------------------------------- */ function round_time (time, fraction) { -- cgit v1.2.3