You can easily test it - just take any node, select Execute script from the context menu and paste your script there. Your script will be executed in the same way as when a template executes it on nodes.
In addition, when you execute it that way you can use println() commands to print, so you can use it for debugging purposes.
In addition, when you execute it that way you can use println() commands to print, so you can use it for debugging purposes.