BURGERS (or was it Burglars?) +=======================+ Given | Programming Challenges - How to be a breathtaking Programmer
BURGERS (or was it Burglars?)
+=======================+
Given three arguments — an object obj of the stolen items, the pets name and a value — return an object with that name and value in it (as key-value pairs).
addName({}, "Brutus", 300) ➞ { Brutus: 300 }
addName({ piano: 500 }, "Brutus", 400) ➞ { piano: 500, Brutus: 400 }
addName({ piano: 500, stereo: 300 }, "Caligula", 440) ➞ { piano: 500, stereo: 300, Caligula: 440 }
The value argument will be a number.+=========+
Please answer to this message with your solution :)
Got a challenge Idea? DM it to @BinaryByter for a chance to be featured on this channel!