[thelist] Javascript (Math Skills Needed)

Christian Heilmann codepo8 at gmail.com
Wed Aug 8 13:06:10 CDT 2007


> Probably a silly question, but what is wrong with the function just
> returning? What should it be doing instead? Just curious since I've used
> this function before.

It is just dirty as it is not called with return fader();

I keep doing that as well:

function bla(){
... stuff ...
if(condition){return;}
... stuff ...
}

which can make it hard to debug when it becomes big. Therefore

function bla(){
if(condition){
... stuff ...
}
}

is unambiguous.

-- 
Chris Heilmann
Book: http://www.beginningjavascript.com
Blog: http://www.wait-till-i.com
Writing: http://icant.co.uk/



More information about the thelist mailing list