Animation Tool's JavaScript scope (this) is set to MovieClip, which executes JavaScript, as its scope. Please note that without the scope (this), it will not start correctly.
Other than that, it is no different from normal JavaScript, so it can be run using either the conventional writing method or ES6 writing.