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
Thanawit Thisanon
nodejs-60-2
Commits
702bd059
Commit
702bd059
authored
7 years ago
by
Thanawit Thisanon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
การบ้าน week03 ขอ2คะแนน
parent
92f0c884
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
1 deletion
+61
-1
index.js
student/index.js
+1
-1
index.js
week03/index.js
+41
-0
package-lock.json
week03/package-lock.json
+5
-0
package.json
week03/package.json
+14
-0
No files found.
student/index.js
View file @
702bd059
const
massage
=
"Helo world"
;
const
massage
=
"Helo world"
;
let
name
=
""
;
let
name
=
""
;
console
.
info
(
massage
);
console
.
info
(
massage
);
/*const readline = require('readline');
/*const readline = require('readline');
const fs = require('fs');
const fs = require('fs');
...
...
This diff is collapsed.
Click to expand it.
week03/index.js
0 → 100644
View file @
702bd059
const
readline
=
require
(
'readline'
);
const
r
=
readline
.
createInterface
({
input
:
process
.
stdin
,
output
:
process
.
stdout
});
// r.question('กรอกชื่อ :', (name) => {
// r.question('กรอกปีเกิด:', (date) => {
// date = 2561 - date
// r.question('ขอเบอร์ด้วยจ้า:', (Phone) => {
// console.log(`ชื่อ: ${name} อายุ: ${date} เบอร์โทร: ${Phone}`);
// r.close();
// });
// });
// });
let
i
=
0
;
let
label
=
[
'name'
,
'year'
,
'phone'
];
let
data
=
[];
console
.
log
(
'กรอกชื่อ :'
);
r
.
on
(
'line'
,
(
line
)
=>
{
data
[
label
[
i
]]
=
line
;
if
(
i
==
0
)
{
data
[
label
[
i
]]
=
line
;
console
.
log
(
'กรอกปีเกิด พ.ศ. :'
)
i
++
}
else
if
(
i
==
1
)
{
data
[
label
[
i
]]
=
line
;
console
.
log
(
'เบอร์โทร :'
)
i
++
}
else
if
(
i
==
2
)
{
data
[
label
[
i
]]
=
line
;
console
.
log
(
`สวัสดีคุณ:
${
data
[
'name'
]}
อายุ:
${
2561
-
data
[
'year'
]}
เบอร์โทร:
${
data
[
'phone'
]}
`
);
r
.
close
();
}
})
r
.
on
(
'close'
,
()
=>
r
.
close
())
This diff is collapsed.
Click to expand it.
week03/package-lock.json
0 → 100644
View file @
702bd059
{
"name"
:
"week03"
,
"version"
:
"1.0.0"
,
"lockfileVersion"
:
1
}
This diff is collapsed.
Click to expand it.
week03/package.json
0 → 100644
View file @
702bd059
{
"name"
:
"week03"
,
"version"
:
"1.0.0"
,
"description"
:
"การบ้านสัปดาห์ที่ 3"
,
"main"
:
"index.js"
,
"scripts"
:
{
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
},
"keywords"
:
[
"homework03"
],
"author"
:
"thanawit"
,
"license"
:
"ISC"
}
This diff is collapsed.
Click to expand it.
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