Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
nodejs-60-2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Natchaya Sripaksee
nodejs-60-2
Commits
9e3eab27
Commit
9e3eab27
authored
Jan 31, 2018
by
Natchaya Sripaksee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ส่งการบ้านweek3
parent
738af216
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
14 deletions
+10
-14
index.js
nodejs-60-2/week3/index.js
+10
-14
No files found.
nodejs-60-2/week3/index.js
View file @
9e3eab27
...
...
@@ -18,19 +18,17 @@
const
rl
=
require
(
'readline'
);
const
r
=
rl
.
createInterface
(
input
=
process
.
stdin
)
let
i
=
1
let
label
=
[
'name'
,
'year'
,
'phone'
]
r
.
on
(
'line'
,
(
line
)
=>
{
let
i
=
0
data
[
label
[
i
]
=
line
console
.
log
(
`line ==
${
line
}
and i=
${
i
}
`
)
i
++
;
if
(
i
==
3
)
{
console
.
log
(
'label'
.
label
)
console
.
log
(
'data'
,
data
)
r
.
close
();
let
data
=
[]
r
.
on
(
'line'
,
(
line
)
=>
{
data
[
i
]
=
line
//console.log(${label[i]} == ${line} and i = ${i})
i
++
if
(
i
==
3
)
{
data
[
1
]
=
2561
-
data
[
1
]
console
.
log
(
`สวัสดีคุณ
${
data
[
0
]}
เบอร์
${
data
[
2
]}
คุณอายุ
${
data
[
1
]}
ปี `
)
r
.
close
()
}
})
\ No newline at end of file
r
.
on
(
'close'
,
()
=>
r
.
close
())
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment