I’m starting with meteor and I would like to create a global function in a function.js file.
Then I would like to use this function in another template helpers.
What you are doing here is not creating a generic global function, you are creating a global Template helper. Note also that UI.registerHelper is deprecated syntax for Template.registerHelper - check the documentation for what this does.
If you just want a generic, global function, just create a generic, global function:
myFunction = function(a,b) {
// do something
}
However, you will need to ensure the file containing this is loaded ahead of its use. Of course, you really shouldn’t be polluting the global namespace with random names, so you would preferably define this within the context of a template (normally in the onCreated callback), or if it must be global, within a suitable namespace.