-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTest2.js
62 lines (52 loc) · 1.09 KB
/
Test2.js
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
53
54
55
56
57
58
59
60
var x = 1;
var y = false;
//label : console.log("\u0067");
var Home = function () {
var that = this;
this.color = 'yellow';
{
var purchasePrice = '640K';
}
// console.log(purchasePrice);
// return
};
Home.prototype.garageSize = function(){
return 100;
}
//console.log(color);
Home();
//myHome.decoration = "New Decoration";
console.log(color);
// console.log(myHome.decoration);
// delete myHome.decoration;
// console.log(myHome.decoration);
// for(var property in myHome)
// {
// if(typeof myHome[property] !== 'function')
// {
// console.log(property.valueOf());
// }
// }
var objectLiteral = {
name: 'shashwat',
age: 32
}
Object.beget = function(o)
{
var x = function(){}
x.prototype = o;
x.design = "newdesign";
return new x();
}
Object.beget2 = function(o)
{
var x = function(){}
// x.prototype = o;
var z = new x();
x.prototype = o;
var r = new x();
return z;
}
// var another_home = Object.beget(myHome);
// var another_home2 = Object.beget2(myHome);
// another_home2.prototype = new Home();