PDA

View Full Version : Naming properties and parameters in constructors


tenoch
12-02-2003, 08:12 AM
Hello!

Would naming the properties and parameters of a constructor with the same names like this cause problems?:function Myself(age, gender, weight) {
this.age = age;
this.gender = gender;
this.weight = weight;
}I've seen examples where this is done while others seem to use different names. Is one way better than the other? If so, why?

I'm just starting out in the object-bisniss, so don't laugh if this is stupid, ok? :p

Thanx for any replies! :)

tg
12-02-2003, 12:17 PM
nope, just preference.... but i find that when i keep using the same words over and over again... when i come back to do maintenance on the project, it can get confusing. basically its all personal preference and what you feel good with.

tenoch
12-03-2003, 11:01 AM
Ahhh, great! Good to know.

Thanks, tg! :)