I've an object looks like this:
var obj ={
property : '',
myfunction1 : function(parameter){
//do stuff here
}
}
I need to set some private properties and functions, which can not be accessed/seen from outside of the object. It is not working with
var property:,
or var myFunction1
Next question is, if I call a function within or outside the object, I always have to do this with obj.myfunction()
. I would like to asign "this" to a variable. Like self : this
. and call inside the object my functions and variables with self.property
and self.myfunction
.
How? :)