Ad
  • Custom User Avatar

    The behavior is the same, but they are not the same thing, in the first sample it's creating a function for each and every object created (waste of memory), while in the second it's adding the function to the prototype, thus one function is being 'shared' by every object.

  • Custom User Avatar

    I might be incorrect, but I believe these 2 are the same thing?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I think you solved the exercise as intendid.

    I was a bit consfused by this at first but after some exploring I think I get it now.

    When you did
    HumanSkin.prototype = new Cylon()
    You created a property for all new HumanSkins called model. But since you never passed a model to
    the new Cylon() you were inheriting from, model was left as undefined. Therefor you had to define a model of your own
    within HumanSkin.

    I hope that makes sense. Anybody, please correct me if I'm wrong.