JavaScript:
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
| /*diepte test*/ test1 = function (){ } test1.prototype = new Array test1.prototype.getValue = function (){ } test1.prototype.setValue = function (){ } test2 = function (){ } test2.prototype = new test1 test2.prototype.getList = function (){ } test2.prototype.setList = function (){ } test3 = function (){ } test3.prototype = new test2 test3.prototype.getWorld = function (){ } test3.prototype.setWorld = function (){ } test4 = function (){ } test4.prototype = new test3 test4.prototype.getSpace = function (){ } test4.prototype.setSpace = function (){ } |
als ik van de bovenstaande code de output bekijk zie ik dit:
code:
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
| Level #0:
Variable _level0.$version = "WIN 6,0,79,0"
Variable _level0.test1 = [function] {
prototype:[object #2, class 'Array'] [
getValue:[function 'getValue'],
setValue:[function 'setValue']
]
}
Variable _level0.test2 = [function] {
prototype:[object #6, class 'Array'] {
getList:[function 'getList'],
setList:[function 'setList']
}
}
Variable _level0.test3 = [function] {
prototype:[object #10] {
getWorld:[function 'getWorld'],
setWorld:[function 'setWorld']
}
}
Variable _level0.test4 = [function] {
prototype:[object #14] {
getSpace:[function 'getSpace'],
setSpace:[function 'setSpace']
}
} |
Object test3 en test4 hebben geen Class meer. terwijl ze gebasseerd zijn op test2 die dus wel een Class heeft.
Ga ik gewoon te diep of doe ik nu iets grandioos fout