I add properties to this function in this way and then I log the function to the console.
function x(){
}
x.y = 5
x.z = 10
x.propertyTest = () => {
return "this is the result"
}
console.log(x) returns { [Function: x] y: 5, z: 10, propertyTest: [Function] }
It seems that it is not putting these properties into the x function but instead is putting the x function and all the properties we added into an object and then automatically declaring this new object as the x function.
Is this what is happening?