mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 02:53:31 +01:00
docs: collection first, firstKey, last, lastKey
"count is negative" -> "amount is negative"
This commit is contained in:
@@ -62,7 +62,7 @@ class Collection extends Map {
|
|||||||
* Obtains the first value(s) in this collection.
|
* Obtains the first value(s) in this collection.
|
||||||
* @param {number} [amount] Amount of values to obtain from the beginning
|
* @param {number} [amount] Amount of values to obtain from the beginning
|
||||||
* @returns {*|Array<*>} A single value if no amount is provided or an array of values, starting from the end if
|
* @returns {*|Array<*>} A single value if no amount is provided or an array of values, starting from the end if
|
||||||
* count is negative
|
* amount is negative
|
||||||
*/
|
*/
|
||||||
first(amount) {
|
first(amount) {
|
||||||
if (typeof amount === 'undefined') return this.values().next().value;
|
if (typeof amount === 'undefined') return this.values().next().value;
|
||||||
@@ -78,7 +78,7 @@ class Collection extends Map {
|
|||||||
* Obtains the first key(s) in this collection.
|
* Obtains the first key(s) in this collection.
|
||||||
* @param {number} [amount] Amount of keys to obtain from the beginning
|
* @param {number} [amount] Amount of keys to obtain from the beginning
|
||||||
* @returns {*|Array<*>} A single key if no amount is provided or an array of keys, starting from the end if
|
* @returns {*|Array<*>} A single key if no amount is provided or an array of keys, starting from the end if
|
||||||
* count is negative
|
* amount is negative
|
||||||
*/
|
*/
|
||||||
firstKey(amount) {
|
firstKey(amount) {
|
||||||
if (typeof amount === 'undefined') return this.keys().next().value;
|
if (typeof amount === 'undefined') return this.keys().next().value;
|
||||||
@@ -95,7 +95,7 @@ class Collection extends Map {
|
|||||||
* mechanism applies here as well.
|
* mechanism applies here as well.
|
||||||
* @param {number} [amount] Amount of values to obtain from the end
|
* @param {number} [amount] Amount of values to obtain from the end
|
||||||
* @returns {*|Array<*>} A single value if no amount is provided or an array of values, starting from the end if
|
* @returns {*|Array<*>} A single value if no amount is provided or an array of values, starting from the end if
|
||||||
* count is negative
|
* amount is negative
|
||||||
*/
|
*/
|
||||||
last(amount) {
|
last(amount) {
|
||||||
const arr = this.array();
|
const arr = this.array();
|
||||||
@@ -110,7 +110,7 @@ class Collection extends Map {
|
|||||||
* mechanism applies here as well.
|
* mechanism applies here as well.
|
||||||
* @param {number} [amount] Amount of keys to obtain from the end
|
* @param {number} [amount] Amount of keys to obtain from the end
|
||||||
* @returns {*|Array<*>} A single key if no amount is provided or an array of keys, starting from the end if
|
* @returns {*|Array<*>} A single key if no amount is provided or an array of keys, starting from the end if
|
||||||
* count is negative
|
* amount is negative
|
||||||
*/
|
*/
|
||||||
lastKey(amount) {
|
lastKey(amount) {
|
||||||
const arr = this.keyArray();
|
const arr = this.keyArray();
|
||||||
|
|||||||
Reference in New Issue
Block a user