Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cmsc388Bwinter2022-student
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andrej Petar Rasevic
cmsc388Bwinter2022-student
Commits
b33900d8
Commit
b33900d8
authored
3 years ago
by
Andrej Rasevic
Browse files
Options
Downloads
Patches
Plain Diff
adding first module example
parent
f18793f7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
codeExamples/week1/driver.js
+8
-0
8 additions, 0 deletions
codeExamples/week1/driver.js
codeExamples/week1/person.js
+36
-0
36 additions, 0 deletions
codeExamples/week1/person.js
with
44 additions
and
0 deletions
codeExamples/week1/driver.js
0 → 100644
+
8
−
0
View file @
b33900d8
const
modules
=
require
(
'
./person
'
)
console
.
log
(
modules
)
let
p1
=
new
modules
.
Person
(
"
Jessica
"
,
35
)
let
s1
=
new
modules
.
Stu
(
"
Amy
"
,
3.5
)
console
.
log
(
p1
.
toString
())
console
.
log
(
s1
.
toString
())
This diff is collapsed.
Click to expand it.
codeExamples/week1/person.js
0 → 100644
+
36
−
0
View file @
b33900d8
class
Person
{
constructor
(
name
,
age
){
this
.
name
=
name
;
this
.
age
=
age
;
}
toString
(){
return
"
Name is:
"
+
this
.
name
+
"
age is
"
+
this
.
age
;
}
}
class
Student
{
constructor
(
name
,
gpa
){
this
.
name
=
name
;
this
.
gpa
=
gpa
;
}
toString
(){
return
"
Name is:
"
+
this
.
name
+
"
gpa is
"
+
this
.
gpa
;
}
}
function
saySomething
(
phrase
)
{
console
.
log
(
phrase
)
}
module
.
exports
.
Person
=
Person
;
module
.
exports
.
Stu
=
Student
;
module
.
exports
.
saySomething
=
saySomething
;
module
.
exports
=
{
Person
:
Person
,
Stu
:
Student
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment