I have some javascript code and to my mind code is messy. So i want to do something that allow me to avoid word 'object' when I invoke methods and work with fields. Can I do something with it?
object = {
init: function() {
object.someField = 1;
object.anotherField = 2;
}
};
object.someMethod = function(){
object.anotherMethod();
};
object.anotherMethod = function(){
alert('anotherMethod');
};