See also:
- How to add JavaScript / CSS / Less with a custom module
- How to load JavaScript or stylesheet conditionally depends on backend config settings
- How to pass parameters from *.phtml to a JavaScript component using x-magento-init
- domReady!: a useful RequireJS plugin to ensure the DOM is loaded before your Magento 2 JavaScript execution