I can think of several places where I would do this
Simple testing of an idea, I want to see how something works and don't intend to keep the code.
Data initialization, where the actual program logic is in an external file but I want to load initial data for some reason and don't want to have an ajax call to get it. For example if I have a list of countries that I will need to use that would be a perfect candidate. It will change rarely and can be inserted into the HTML page by way of whatever language I am using server side (PHP, Ruby, Haskell etc), in this case I may have some code like this
Data.countries = ;