How to defer javascript?

I want to ensure my plugin js does not run until the page is loaded by including the ‘defer’ attribute.

So when adding assets like this:

$this->assets->add('js', 'plugin://mylist-video-player/js/mylist-player.js');

how do I add the defer attribute so that it will output as:

<script src="/grav/user/plugins/mylist-video-player/js/mylist-player.js" type="text/javascript" defer></script>
---

This is documented on the Asset Manger page of the learn site.

Ah yes indeed. Thank you!