Skip to content

Commit ee3b48e

Browse files
javascript STDIN
1 parent a1f4dfc commit ee3b48e

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

javascript.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,21 @@ Javascript(JS) is a object-oriented programming language which adhere to ECMA Sc
1616

1717
# Syntax help
1818

19+
## STDIN Example
20+
21+
```javascript
22+
var readline = require('readline');
23+
var rl = readline.createInterface({
24+
input: process.stdin,
25+
output: process.stdout,
26+
terminal: false
27+
});
28+
29+
rl.on('line', function(line){
30+
console.log("Hello, " + line);
31+
});
32+
```
33+
1934
## variable declaration
2035

2136
|Keyword|Description|Scope|
@@ -27,7 +42,7 @@ Javascript(JS) is a object-oriented programming language which adhere to ECMA Sc
2742
## Backtick Strings
2843

2944
### Interpolation
30-
```
45+
```javascript
3146
let greetings = `Hello ${name}`
3247
```
3348
### Multi line Strings

0 commit comments

Comments
 (0)