Skip to content

Commit aa96c54

Browse files
committed
Update classical-inherit.js
// classical inherit #4
1 parent 675dff7 commit aa96c54

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

classical-inherit.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,14 @@ var object = new Child('Alex');
6767
console.log(object.sayHi()); // Hi Alex
6868

6969
// minuses: performance degradation
70+
71+
72+
// classical inherit #4
73+
74+
75+
function inherit(C, P){
76+
C.prototype = P.prototype
77+
}
78+
79+
// minuses: copies only prototypes.
80+
}

0 commit comments

Comments
 (0)