JS is not needed for some defined build-in commands [0]. Custom commands will emit an Event only which probably should end up in some JS function most of the time.
[0] https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/...