Miss any of our Open RFC calls?Watch the recordings here! »

asteroids-bag

0.0.1 • Public • Published

asteroids-bag

An implementation of a bag tailored to Asteroids

Examples

var Bag = require('asteroids-bag');
 
var bag = new Bag();
var identifier = bag.add({ 'an': 'object' });
 
bag.forEach(function(element, id){
    console.log('we found an element with id: %s', id);
    console.log(element);
})
 
bag.remove(identifier);
bag.forEach(function(){
    console.log('this will not show because bag is empty');
});

Output:

we found an element with id: f624a2c94c204058b9689687d1868a22
{ an: 'object' }

Keywords

none

Install

npm i asteroids-bag

DownloadsWeekly Downloads

2

Version

0.0.1

License

none

Last publish

Collaborators

  • avatar