BRIEF: I have frequented SO for years, but this is my first post. I've heavily searched SO for this, so I'm sorry if I overlooked it and this is a duplicate.
function actionFunction(values) {
this.defaultValues = {
valueX : 2.5,
valueY : 5.5
};
this.valuesRanges = {
xRange : { min : 0, max : 10 },
yRange : { min : 5, max : 10 }
};
};
Obviously I can access these within the function itself using this.defaultValues.valueX
, etc. What I'd like to know is how to access these outside of the function? I'm aware this is most likely a return
or scope/hoisting problem and just do not know how to attack it.
Essentially, I need to get actionFunction.defaultValues.valueX
. Also, I'd like to get the values inside of actionFunction.valuesRanges.xRange
. I've tried these as arrays and more, but just can't figure out the correct, proper methodology. I have a multitude of functions structured like this that I need to pull these values from, so a modular way to do so without bringing in jQuery just for $.extend()
and other basal functionality at the cost of overhead would be great.
EDIT I realized after posting this that I forgot to mention I was properly calling var example = new actionFunction();
, but for some reason am/was having issues.
That said, what would be a cleaner and more logical, reliable way to store these values within the function as opposed to the this
method so that they could still be grabbed by an exterior call for the values like previously mentioned?