How to add custom Javascript in head in Magento 2

- Magento 2

Magento 2 Development

To add a custom Javascript file in head in Magento 2, use the following example:

Source (Magento Stackexchange Question) (Amit Bera)

More Magento 2 tips from the Cookbook