From c93d06900664f27afb87a306c0868c68e72c122d Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 14 Jul 2020 04:31:02 +0300 Subject: [PATCH] notes... Signed-off-by: Alex A. Naanou --- ui (gen4)/lib/util.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ui (gen4)/lib/util.js b/ui (gen4)/lib/util.js index 18b4414a..2ebc202c 100755 --- a/ui (gen4)/lib/util.js +++ b/ui (gen4)/lib/util.js @@ -127,9 +127,7 @@ Array.prototype.toMap = function(normalize){ // Return an array with duplicate elements removed... // -// NOTE: we are not using an Object as an index here as an Array can -// contain any type of item while Object keys can only be strings... -// NOTE: this may not work on IE... +// NOTE: order is preserved... Array.prototype.unique = function(normalize){ return normalize ? [...new Map(this.map(function(e){ return [normalize(e), e] })).values()]