I am learning JavaScript and read that functions are like objects and can have properties set like this:
var person = function(){
}
person.name=\"John Smith\
You can change the name property!
The Function.name property is configurable as detailed on MDN.
Since it's configurable, we can alter its writable property so it can be changed. We need to use defineProperty to do this:
var fn = function(){};
Object.defineProperty(fn, "name", {writable:true});
// now you can treat it like a normal property:
fn.name = "hello";
console.log(fn.name); // outputs "hello"