I want to clone a function that is inside another function and pass new value. But in this case, is it possible?
function big({ message, info }) {
function small() {
console.log(message);
}
return { small }
}
const { small } = big({});
small() // this will print undefined
/*
clone to a new function with different values
const small_clone = do something here with the small function, not touching the big one
small_clone({ message: 'hello' }) // this will print hello
*/