mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-12 03:45:45 +01:00
Long awaited augmentation of the :map command. Surrounding code needs cleanup.
--HG-- extra : rebase_source : 6bb2406343f04aff20456e1a9d0cb595f4ec767d
This commit is contained in:
@@ -937,6 +937,17 @@ const array = Class("array", Array, {
|
||||
*/
|
||||
compact: function compact(ary) ary.filter(function (item) item != null),
|
||||
|
||||
/**
|
||||
* Returns true if each element of ary1 is equal to the
|
||||
* corresponding element in ary2.
|
||||
*
|
||||
* @param {Array} ary1
|
||||
* @param {Array} ary2
|
||||
* @returns {boolean}
|
||||
*/
|
||||
equals: function (ary1, ary2)
|
||||
ary1.length == ary2.length && Array.every(ary1, function (e, i) e == ary2[i]),
|
||||
|
||||
/**
|
||||
* Flattens an array, such that all elements of the array are
|
||||
* joined into a single array:
|
||||
|
||||
Reference in New Issue
Block a user