Let's say I have an Object
var bar = {hi: 1, there: 2};
I would like to, at the end of the function, return the same object that was passed while at the same time doing a destructuring assignment in the function param.
It might look like this:
function foo({hi, there}){
//logic with variables "hi" and "there"
return ...arguments;
}
and have the return value be the same as bar;
for obvious reasons the spread operator doesn't work in this context, but I'm wondering if there is a simple way to do this or something similar.