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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
15 deletions
+13
-15
index.js
nodejs-60-2/week3/index.js
+13
-15
No files found.
nodejs-60-2/week3/index.js
View file @
9e3eab27
...
@@ -18,19 +18,17 @@
...
@@ -18,19 +18,17 @@
const
rl
=
require
(
'readline'
);
const
rl
=
require
(
'readline'
);
const
r
=
rl
.
createInterface
(
input
=
process
.
stdin
)
const
r
=
rl
.
createInterface
(
input
=
process
.
stdin
)
let
i
=
1
let
label
=
[
'name'
,
'year'
,
'phone'
]
let
i
=
0
r
.
on
(
'line'
,
(
line
)
=>
{
data
[
label
[
i
]
=
line
let
data
=
[]
console
.
log
(
`line ==
${
line
}
and i=
${
i
}
`
)
r
.
on
(
'line'
,
(
line
)
=>
{
i
++
;
data
[
i
]
=
line
if
(
i
==
3
)
{
//console.log(${label[i]} == ${line} and i = ${i})
console
.
log
(
'label'
.
label
)
i
++
console
.
log
(
'data'
,
data
)
if
(
i
==
3
)
{
r
.
close
();
data
[
1
]
=
2561
-
data
[
1
]
}
console
.
log
(
`สวัสดีคุณ
${
data
[
0
]}
เบอร์
${
data
[
2
]}
คุณอายุ
${
data
[
1
]}
ปี `
)
r
.
close
()
})
}
r
.
on
(
'close'
,
()
=>
r
.
close
())
})
\ No newline at end of file
\ 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