YUI Blog on JavaScript
Even if you aren’t a user of the Yahoo User Interface library this post from
Do not usenew Functionto create function values. Use function expressions instead. For example,is better written asframes[0].onfocus = new Function("document.bgColor='antiquewhite'")The second form allows the compiler to see the function body sooner, so any errors in it will be detected sooner. Sometimesframes[0].onfocus = function () {document.bgColor = 'antiquewhite';};new Functionis used by people who do not understand how inner functions work.
