Then we can have the onClicked signal of a Button call our "phrase2 ()" function
Next in your QML file declare the .js file
Now you can call that function inside of a Button onClicked signal by doing the following
I like to use defined functions within the QML for longer/used multiple times within that one QML file functions. And I like to use functions defined for very long or functions that will be used in multiple QML files.