In javascript given this three constructor functions:
function Foo(data) {
var _data = data;
}
function Bar(data) {
this.data = data;
}
function Baz(data) {
//just use data freely.
}
Is there any difference aside from the visibility of the data
member after construction ? (e.g. you can do new Bar().data
but not new Foo().data
)