I'm using the Object.init pattern in my application. Where within the init i initialize variables attached to the object, for example:
var MyObject = {
 init: function() {
   this.element = $('.someElement');
   this.element.bind('click', this._doSomething.bind(this));
 },
 _doSomething = function() {
    // METHOD WHICH I WILL MANIPULATE THIS.ELEMENT
 }
};
What i'm trying to know is, if i have to create some variables inside the method _doSomething, should i attach the variables to the MyObject with this, like this:
this.someVar = 'something';
Or should i use var:
var someVar = 'something';
I think the best way is use this if i will use the someVar in other parts of MyObject, and i should var if i use only in the scope of _doSomething method.
But this is my opinion, i want know the best practice.
Thanks.
 
     
    