I normally do:
var x;
x = new Slider({
'dragstart' : function(e,ui){
// blablabla
x.addClass('being-dragged'); // using X here.
// blablabla
}
});
Instead, should I be confident to do
var x = new Slider({
'dragstart' : function(e,ui){
// blablabla
x.addClass('being-dragged'); // using X here.
// blablabla
}
});
The way I see things, x
doesn't exist in the local scope when that function is being constructed, so I keep worrying it might pick another x
from global, window or wherever it finds it.