Skip to content

Instantly share code, notes, and snippets.

@scriptonian
Created January 11, 2018 16:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scriptonian/c78b151ec27f36c7215b493033d9538e to your computer and use it in GitHub Desktop.
Save scriptonian/c78b151ec27f36c7215b493033d9538e to your computer and use it in GitHub Desktop.
var book = {
tarzan : { publisher: "Pub A", author: "Author A", pageCount: 300},
"hidden universe" : { publisher: "Pub B", author: "Author B", pageCount: 1000},
addBook : ....,
removeBook : function(name) {
this[name].name = name; //<-
var temp = this[name];
delete this[name];
return temp;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment