J
Josh Russo
This is mainly for Dave, but anyone feel free to jump in.
So I've been reading up on prototype and I think I have a pretty good
handle on it now. What I am confused about is the general terminology.
function Person(pname){
this.name = pname;
this.children = []
this.addChild(cname){
this.children.push(new Person(cname));
}
}
If a class is the definition of an object, why can I not refer to the
above as a class? (btw Dave the crockford.com site you referred me to
does from time to time refer to them as classes.) What is the
preferred description? Object structure, Object function, Object
definition, [any statement that conveys the fact that it is
representing the structure of an object without calling it a class]?
Instances. Dave, you have said that calling JS variables instances
creates confusion. The only confusion I have is around this statement.
What does it matter? *Why* shouldn't we call them instances? And if
not, what should we call them?
Thanks for your help.
So I've been reading up on prototype and I think I have a pretty good
handle on it now. What I am confused about is the general terminology.
function Person(pname){
this.name = pname;
this.children = []
this.addChild(cname){
this.children.push(new Person(cname));
}
}
If a class is the definition of an object, why can I not refer to the
above as a class? (btw Dave the crockford.com site you referred me to
does from time to time refer to them as classes.) What is the
preferred description? Object structure, Object function, Object
definition, [any statement that conveys the fact that it is
representing the structure of an object without calling it a class]?
Instances. Dave, you have said that calling JS variables instances
creates confusion. The only confusion I have is around this statement.
What does it matter? *Why* shouldn't we call them instances? And if
not, what should we call them?
Thanks for your help.