I was just wondering if there was a way to extract the arguments of a function x(...){...} to the global scope and maybe store them into a variable.
I know that if you construct a function, you can return the "arguments" object, but that is not what I want because the function is unknown.
To give a bit of context as of why I want to do this, I'm trying to create a function "a" that receives a function "x" as a parameter, and I need to return a function "y" that, when called, will check if it has already computed the result for the given argument and return that value instead if possible.
I'm aware that this is probably not the best approach to get it done.