codeGK
Code it ALL
JavaScript Print - CodeGK
♦ JavaScript Print

♣ About Print in JavaScript

There are various ways of printing in JavaScript.
Let us see them below.

♣ Example1: document.write() in JavaScript

In this example, document.write() is illustrated.
Example
Input:
Output:

♣ Example2: windows.alert() in JavaScript

In this example, windows.alert() is illustrated.
Example
Input:
Output:

♣ Example3: console.log() in JavaScript

In this example, console.log() is illustrated.
Example
Input:
Output:
Prev_LessonNext_Lesson