Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Foo = function (a)
- {
- this.a = a
- }
- Foo.prototype =
- {
- helloFoo: function ()
- {
- console.log('Foo: a =', this.a)
- }
- }
- var Bar = function (a, b)
- {
- Foo.call(this, a)
- this.b = b
- }
- Bar.prototype = $.extend(
- {
- helloBar: function ()
- {
- console.log('Bar: a =', this.a, ', b =', this.b)
- }
- }, Foo)
- var bar = new Bar(23, 'skidoo')
- bar.helloFoo()
- bar.helloBar()
- // Foo: a = 23
- // Bar: a = 23 , b = skidoo
Add Comment
Please, Sign In to add comment