diff --git a/index.js b/index.js index e69de29bb..d017757ce 100644 --- a/index.js +++ b/index.js @@ -0,0 +1,21 @@ +var recipes = {}; + +function updateObjectWithKeyAndValue(recipes, key, value) { + return Object.assign({}, recipes, { [key]: value}) +} + +function destructivelyUpdateObjectWithKeyAndValue(recipes, key, value) { + recipes[key] = value; + return recipes; +} + +function deleteFromObjectByKey(recipes, key) { + var newRecipes = Object.assign({}, recipes); + delete newRecipes[key]; + return newRecipes; +} + +function destructivelyDeleteFromObjectByKey(recipes, key) { + delete recipes[key]; + return recipes; +}