Loading

Quipoin Menu

Learn • Practice • Grow

java-script / JavaScript Output
interview

Q1. What is console.log() in JavaScript?
console.log() is used to display output inside the browser's console. It is mainly used for debugging and testing code.

Example
console.log("Hello JavaScript");

Output

Displayed in the browser console:
Hello JavaScript

Developers use this method to check variable values and program execution.


Q2. What is document.write() in JavaScript?
document.write() is used to display output directly on the web page.

Example
document.write("Welcome to JavaScript");

Output
The text appers on the webpage.

Important Note:
It should not be used after the page is fully loaded.
It can overwrite the entrie page content.


Q3. What is innerHTML in JavaScript?
innerHTML is used to change or display HTML content inside an element.

Example
document.getElementById("demo").innerHTML = "Hello User";

This updates the content inside the element with the given ID. It is widely used for dynamic web content.