-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlec16.html
More file actions
52 lines (43 loc) · 1.04 KB
/
lec16.html
File metadata and controls
52 lines (43 loc) · 1.04 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
// call bind apply
//use for data sharing
// call use for single parameter
// apply for more than one
//bind will give output when it calls it do not run immediately
// let obj={
// id:1,
// name:"rahul",
// lastName:"kumar",
// getFullName:function(age,ispass,a){
// console.log(this.name+" "+this.lastName+" "+age+" "+ispass+" "+a);
// }
// }
// let obj1={
// id:2,
// name:"sakshi",
// lastName:"jaiswal"
// }
// //obj.getFullName.call(obj1,22,true)
// //obj.getFullName.apply(obj1,22,true,3)
// let data= obj.getFullName.bind(obj1,[])
// data()
//CONSTRUCTOR
function user(a,b){
this.userName=a,
this.lastName=b
}
let data= new user("rahul","jain")
let data1=new user("rohit","jain")
console.log(data);
console.log(data1);
</script>
</body>
</html>