Output
innerHTML
<div id = "demo"></div>

<script>
	document.getElementById("demo").innerHTML = "Hello Javascript";
</script>
		
document.write
  • Using document.write() after an HTML document is loaded, will delete all existing HTML
  • <script>
    	document.write(5+6)
    </script>
    		
    window.alert
    <script>
    	window.alert(5 + 6);
    </script>
    		
    console.log
    <script>
    	console.log("Hello World!")
    </script>
    		
    Print Object
    const car = {
      color: 'black',
      manufacturer: 'Ford',
      model: 'Fiesta'
    }
    
    console.log(car)
    console.dir(car) // same as console.log('%O', car)
    document.write(JSON.stringify(car));