javascript
javascript
Input/Output in Javascript
Live
bolt
Level1
Progress0%

Input/Output in Javascript

CARD 1

Introduction

Login to report note issues for this section.

Basic Input / Output — console.log, prompt

Input and output (I/O) are the most fundamental operations in any program. Input is data the program receives. Output is data the program sends out — to the screen, console, or another system.

In JavaScript, the basic I/O tools differ depending on the environment:

EnvironmentOutputInput
Browserconsole.log, alertprompt, confirm
Node.jsconsole.logprocess.stdin, readline module