diff --git a/index.js b/index.js index e69de29bb2..7d17d29496 100644 --- a/index.js +++ b/index.js @@ -0,0 +1,23 @@ +var obj = {} + +function updateObjectWithKeyAndValue(obj, key, value){ + return Object.assign ({}, obj, { [key]: value }); +} + +function destructivelyUpdateObjectWithKeyAndValue (obj, key, value){ + obj.prop2 = 2 + return obj; +} + +function deleteFromObjectByKey(obj, key){ + var obj = { prop: 1 } + var newObj = Object.assign({}, obj) + delete newObj.prop + return newObj + return obj +} + +function destructivelyDeleteFromObjectByKey(obj, key){ + delete obj.prop; + return obj; +}