I found similar questions, but none of them answered this explicitly, so I hope someone can help me figure it out.
Regarding design functions, I'm trying to figure out if variables and functions are public or private by default.
For example, I have this sample constructor with these properties:
function Obj() {
this.type = 'object';
this.questions = 27;
this.print = function() {
console.log('hello world');
}
}
I can name these properties as such:
var box = new Obj();
box.type;
box.print();
It seems to me that both functions and variables are public by default. It is right?
Or, if the functions inside the constructors are private ... can they only accept private variables as parameters?
Thanks.