Skip to content

Instantly share code, notes, and snippets.

@Smithx10
Created February 22, 2018 22:18
Show Gist options
  • Save Smithx10/f5eb7e1d2c3a0d36f31e4e0bb9c29e5a to your computer and use it in GitHub Desktop.
Save Smithx10/f5eb7e1d2c3a0d36f31e4e0bb9c29e5a to your computer and use it in GitHub Desktop.
Teams.prototype.advertiseTeam = function(name) {
setInterval(() => {
console.log('my name is: ' + name);
}, 2000);
}
Teams.prototype.updateTeam = function(name, newname, captain, available) {
assert.string(name, 'name');
assert.optionalString(newname, 'newname');
assert.optionalString(captain, 'captain');
assert.optionalBool(available, 'available');
if (this.getTeam(name)){
if (available) {
if (available === true) {
this.advertiseTeam(name);
}
this.teams[name].avaiable = available
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment