Skip to content
An implementation of a bag tailored to Asteroids
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
test
.gitignore
.node-version
.travis.yml
LICENSE
README.md
package.json

README.md

asteroids-bag Build Status

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' }
Something went wrong with that request. Please try again.