Advertisement
Guest User

Untitled

a guest
Jul 6th, 2015
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. var Fruit = function() {}
  2.  
  3. Fruit.prototype = {
  4. color: function () {
  5. console.log('Fruit color...')
  6. }
  7. }
  8.  
  9. var Apple = function () {}
  10.  
  11. Apple.prototype = new Fruit()
  12. Apple.prototype.constructor = Apple
  13.  
  14. var a = new Apple()
  15. Apple.prototype = null // the question!!!
  16. a.color()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement