You can declare a function in the header or body of a DataWeave script by using the fun keyword.
De ...