From f3ba36f379aaceaaf05707ff4a7078ad982cdbbc Mon Sep 17 00:00:00 2001 From: daring-demo-aacc Date: Mon, 10 May 2021 21:16:40 +0000 Subject: [PATCH] Done. --- index.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/index.js b/index.js index e69de29bb2..f4def97239 100644 --- a/index.js +++ b/index.js @@ -0,0 +1,17 @@ +function updateObjectWithKeyAndValue(object, key, value){ + var new_obj = Object.assign({},object,{[key]:value}) + return new_obj +} +function destructivelyUpdateObjectWithKeyAndValue(object, key, value){ + object[key] = value + return object +} +function deleteFromObjectByKey(object, key){ + var new_obj = Object.assign({},Object) + delete new_obj[key] + return new_obj +} +function destructivelyDeleteFromObjectByKey(object, key){ + delete object[key] + return object +} \ No newline at end of file