https://javascript.info/function-object

In JavaScript, functions are objects.

A good way to imagine functions is as callable “action objects”.
We can not only call them, but also treat them as objects:
add/remove properties, pass by reference etc.

For example, declear a function,

function test(){
	console.log(this.aaa);
};

Then you can add properties and methods to the function like:

test.aaa=111;
test.bbb=222;
test.func=function(){
	console.log(this.aaa);// this=window, this.aaa=undefined
};