Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Class(object) {
- this.title = object.title;
- this.getTitle = function() {
- return this.title;
- };
- };
- var c1 = new Class({
- title: 'This is class'
- });
- c1.getTitle();
- // define here subclass
- function SubClass(object) {
- this.title = object.title;
- };
- SubClass.prototype = new Class();
- SubClass.prototype.constructor = SubClass;
- // TypeError: Cannot read property 'title' of undefined
Advertisement
Add Comment
Please, Sign In to add comment