Friday, 14 April 2017

Naming classes that are properties of main class

I would like to know how to name constructor function that will be used by my main constructor function, but without the inheritance. Explaining:

I have a constructor function Human:

function Human() {}

And the human has properties like arms, legs, etc:

function Human() {
  this.arms = Arms();
  this.legs = Legs();
}

I would like to know how to name based on the common usage and conventions the Arms and Legs. If i should use:

function Human() {
  this.arms = HumanArms();
  this.legs = HumanLegs();
}

or:

function Human() {
  this.arms = Human.Arms();
  this.legs = Human.Legs();
}

Thank you.



via Fátima Alves

No comments:

Post a Comment