mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 10:33:30 +01:00
Add Collection.map();
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -141,6 +141,16 @@ class Collection extends Map {
|
|||||||
}
|
}
|
||||||
return collection;
|
return collection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Functionally identical shortcut to `collection.array().map(...)`.
|
||||||
|
* @param {function} callback Function that produces an element of the new Array, taking three arguments.
|
||||||
|
* @param {*} [thisArg] Optional. Value to use as this when executing callback.
|
||||||
|
* @returns {array}
|
||||||
|
*/
|
||||||
|
map(...args) {
|
||||||
|
return this.array().map(...args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Collection;
|
module.exports = Collection;
|
||||||
|
|||||||
Reference in New Issue
Block a user