mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
Add Collection.map();
This commit is contained in:
@@ -141,6 +141,16 @@ class Collection extends Map {
|
||||
}
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user