From 4ce83380569d8562cdc23f1aac355b1dbce89ffe Mon Sep 17 00:00:00 2001 From: Nathan Rymarz Date: Fri, 9 Oct 2020 22:03:39 +0000 Subject: [PATCH 1/2] Done. --- index.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/index.js b/index.js index e69de29bb2..e4e9fcbeaf 100644 --- a/index.js +++ b/index.js @@ -0,0 +1,17 @@ +recipes = {} +function updateObjectWithKeyAndValue(obj,key,value){ + return Object.assign({},obj,{[key]:value}); +} +function destructivelyUpdateObjectWithKeyAndValue(obj,key,value){ + obj[key] = value; + return obj; +} +function deleteFromObjectByKey(obj,key){ + var newobj = Object.assign({},obj); + delete newobj[key]; + return newobj +} +function destructivelyDeleteFromObjectByKey(obj,key){ + delete obj[key]; + return obj; +} From 600784029fa37584a3eaa3e55c6a1ecc2fc63415 Mon Sep 17 00:00:00 2001 From: Nathan Rymarz Date: Fri, 9 Oct 2020 23:23:18 +0000 Subject: [PATCH 2/2] Done. --- index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/index.js b/index.js index e4e9fcbeaf..7843025ae7 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,3 @@ -recipes = {} function updateObjectWithKeyAndValue(obj,key,value){ return Object.assign({},obj,{[key]:value}); }