Its probably because I’m over thinking things, but is “else return ..something..” really necessary? Think about it. Shouldn’t both of these snippets give the same result?


if(a == b){
	return true;
}
else return false;

And…


if(a == b){
	return true;
}
return false;

In theory as well that would be a little less file size by removing all “else return…” and leaving just “return…”. I started thinking on this while creating the Gedit Clientside Plugin (try it out).

First off JSLint likes brackets around conditions (even one line conditions). Not sure why as its perfectly ok not to have brackets. This seems more like the developers preference to me. Then JSMin produced bad javascript when handling an else return in some code. Adding brackets or making the change above solved that problem.