-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREPL.js
40 lines (28 loc) · 1.37 KB
/
REPL.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* REPL stands for Read Eval Print Loop and it represents a computer environment like a Windows console or Unix/Linux shell where a command is entered and the system responds with an output in an interactive mode. Node.js or Node comes bundled with a REPL environment. It performs the following tasks −
Read − Reads user's input, parses the input into JavaScript data-structure, and stores in memory.
Eval − Takes and evaluates the data structure.
Print − Prints the result.
Loop − Loops the above command until the user presses ctrl+c twice or ctrl+d once.
The REPL feature of Node is very useful in experimenting with Node.js codes and to debug JavaScript codes. */
//REPL use:
// js Expression
// use variables
// Multiline code / loops
// use underscore( _ ) to get the last result
// we can use editor mode by type ".editor" then you enter in editor mode.
/* When we call a function the value we pass is called Argument.
When we define a function the value which we will pass is called Parameter. */
//type node in terminal then REPL starts sign is ">" press Tab key 2 time to show all modules of Nodejs and press any module name to see all function exist in that module.
//write node then enter
/* $ node
> x = 10
10
> var y = 10
undefined
> x + y
20
> console.log("Hello World")
Hello World
undefined */
//These are some examples of REPL
console.log("Rishav Sinha");