As u may have noticed that our "global" is an object . We can pass functions within . Just make sure about what u want to return and to were "this" is pointing to . Your function will not be global to js instance so " this" will point to your global object .
u will need to take care for it if u will be in need to pass references to "this" . As i dont know how u want to use it , im just warning in case of some surprises .