Why is it that I have to use a new instance of a function in order to get an inner variable, but I can’t use the function itself,
why this works
function bla(){this.a = 1}
b = new bla
alert (b.a)
and this doesn’t
function bla(){this.a = 1}
alert (bla.a)
?
Because you have to call the function in order for the variable to be defined.
If you want to do what you’re talking about, you can use an object literal