'.env file vs constants stored in a file. What is the difference?

I have been using .env files for some time. I want to know if there are any advantages of using .env file (dotenv-javascript) over storing and using constants a normal .js file?

Thanks :)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source