Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Base () { }
- Base.prototype.doWork = function () {
- console.log(this.name);
- }
- function Sub () {
- this.name = 'brian'
- }
- Sub.prototype = Object.create(Base.prototype);
- Sub.prototype.constructor = Sub;
- var sub = new Sub();
- sub.doWork();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement