Skip to content

Commit ec3b4bf

Browse files
committed
files: object constructor added
1 parent 70fbc82 commit ec3b4bf

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ <h1>JavaScript Practice Playground</h1>
1818

1919
<hr>
2020

21-
<script src="./javascript/14-objects.js"></script>
21+
<script src="./javascript/14.01-objects.js"></script>
2222
</body>
2323
</html>

javascript/14.01-objects.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Object Constructor
2+
3+
// These are Parameters -> Argument
4+
// () Round Brackets/Parenthesis
5+
6+
function Person(first, last, age, eye) {
7+
this.firstName = first;
8+
this.lastName = last;
9+
this.age = age;
10+
this.eye = eye;
11+
}
12+
13+
const args = new Person("Abdul", "Wahab", 24, "Black");
14+
15+
document.writeln(args.firstName);
16+
document.writeln(args.lastName);
17+
document.writeln(args.age);
18+
document.writeln(args.eye);
19+
20+
// John
21+
// John's --> Apostrophy('s)

0 commit comments

Comments
 (0)