How to add a new js file in Magento 2?

In the root of your theme add a file named requirejs-config.js and then declare a new javascript file in requirejs-config.jsHow to add a new js file in Magento 2?

How to add a new js file in Magento 2?expoundsofttechsolution