Advertisement
Guest User

Untitled

a guest
Jan 28th, 2017
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. let recipeBook = (function () {
  2. class recipeBook{
  3. constructor(recipes){
  4. this._recipes = recipes || [];
  5. }
  6. addRecipe(recipe){
  7. this._recipes.push(recipe);
  8. }
  9. removeRecipe(id){
  10. this._recipes.splice(id, 1);
  11. }
  12. getRecipes(){
  13. return this._recipes;
  14. }
  15. }
  16. return recipeBook;
  17. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement