1.1.0 • Published 2 years ago
@pteromanager/collection v1.1.0
@PteroManager/Collection
@PteroManager/Collection is an extended class the Map class. It is used to store a collection of objects.
Installation
npm i @pteromanager/collection
How to use it
const { default: Collection } = require('@pteromanager/collection');
const myCollection = new Collection();
myCollection.set('a', 1);
myCollection.set('b', 2);
myCollection.set('c', 3);
console.log(myCollection.get('a'));
// => 1
console.log(myCollection.firstKey());
// => 'a'
console.log(myCollection.firstValue());
// => 1
console.log(myCollection.lastKey());
// => 'c'
console.log(myCollection.lastValue());
// => 3
Support
You can read the documentation for more information or join our Discord Server.