From 6db5d0c4f80459e60dd1baab34aa648109055087 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 9 Sep 2020 22:14:52 +0300 Subject: [PATCH] docs... Signed-off-by: Alex A. Naanou --- Viewer/lib/util.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Viewer/lib/util.js b/Viewer/lib/util.js index d226d549..2a628d76 100755 --- a/Viewer/lib/util.js +++ b/Viewer/lib/util.js @@ -64,12 +64,16 @@ Array.prototype.includes // first/last element access short-hands... // // .first() +// .last() // -> elem // // .first(value) +// .last(value) // -> array // -// +// NOTE: setting a value will overwrite an existing first/last value. +// NOTE: for an empty array both .first(..)/.last(..) will return undefined +// when getting a value and set the 0'th value when setting... Array.prototype.first || (Array.prototype.first = function(value){ return arguments.length > 0 ?