mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
096f13f30d
commit
c93d069006
@ -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()]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user