-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobject.js
More file actions
33 lines (28 loc) · 725 Bytes
/
object.js
File metadata and controls
33 lines (28 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
let student1 = {
nama: "Ale",
age: 28,
programming: ["Php", "Javascript", "Golang", "Java"]
}
let student2 = {
nama: "Yoga",
age: 30,
programming: ["Javascript", "Kotlin"]
}
let student3 = {
nama: "Fadhlan",
age: 40,
programming: ["Javascript", "India"]
}
// constructor function
class StudentsFsw {
constructor(name, age, programmingLanguange){
this.name = name
this.age = age
this.programmingLanguange = programmingLanguange
}
}
// inisialisasi object
let students1 = new StudentsFsw("Hafidh", "30", ["Java"])
let students2 = new StudentsFsw("Adrian", "35", ["PHP"])
let students3 = new StudentsFsw("Diki", "20", ["Javascript"])
console.log(student1)