I am new to this kind of stuff, i gone through several tutorials of js and i found this two type of coding standards of functions, shown below :
return({
error: function(message){
// Code here
},
debug: function(message){
// Code here
}
});
And another one like
this.error = function(message){
//Code Here
};
this.debug = function(message){
//Code Here
};
return this;
I am new in coding, so have a little idea about coding formats. Can you please explain a basic difference between above two snippets ?, but the usage of both are same .