I want to change a function name either directly or by reference.
Obviously a property change works when using objects (or arrays):
let object_1 = { some: "thing" };
let object_2;
object_2 = object_1;
object_2.some = "other";
console.log(object_2.some); // "other"
console.log(object_1.some); // "other" --- because the change was translated to the object1
///// also
let array_1 = [ "some", "thing" ];
let array_2;
array_2 = array_1;
array_2[1] = "other";
console.log(array_2[1]); // "other"
console.log(array_1[1]); // "other" --- because the change was translated to the array_1
However when trying to do the same with functions it doesn't work.
Is it then supposed to be the function.name an intrinsic property created by browser Javascript API when the html page is 'onboarded' into it, and being made immutable?
let function_1 = function() { let a; return a = b + c; };
let function_2;
function_2 = function_1;
console.log(function_1.name); // "function_1"
console.log(function_2.name); // "function_1"
function_2.name = "newname";
console.log(function_2.name); // "function_1" --- ???
console.log(function_1.name); // "function_1" --- this somehow makes sense (but it's opposite to what happens to objects and arrays)