Here is an example where virtually the entire web page is created using document.write statements.
If you look at the source code, you will see that the program consists of almost nothing else!