Accessing class variable with string name?
- by coure06
I have a class like this
$.fn.dimeBar = function(custom) {
var var1 = 'test1';
var var2 = 'test2';
if(sometest){
//how can i access var1 or var2 here by using string name of variables
//some thing like alert(this['var1']) -- should alert: 'test1'
}
}