-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobject.js
More file actions
29 lines (25 loc) · 706 Bytes
/
object.js
File metadata and controls
29 lines (25 loc) · 706 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
var student = {
name : "omor",
age : '120',
cgpa : '3.33',
lang : ['bangla','enlish','hindi']
}
document.write(student.lang);
// use to constractor
function Student(name , age , cgpa , lang){
this.name = name;
this.age = age;
this.cgpa = cgpa;
this.lang =lang;
this.display = function(){
document.write(this.name);
document.write(this.age);
document.write(this.cgpa);
document.write(this.lang);
}
}
var student1 = new Student("omor", '120','3.33',['bangla','enlish','hindi']);
var student2 = new Student("faruk", '120','3.33',['bangla','enlish','hindi']);
// document.write(student1.name);
student1.display();
student2.display();