The main difference is that when you use the document write command, the service you requested is added to your HTML source file. This service may be a third party. But when you use console log, the service you request outputs the parameter you use. So these two commands do completely different jobs.