吴义法

导航

var functionName = function() {}” vs. “function functionName() {}” in Javascript

 alert(typeof foo); // 'function', it's already available
 alert(typeof bar); // 'undefined'
 function foo () {}
 var bar = function () {};
 alert(typeof bar); // 'function'


参考:
http://stackoverflow.com/questions/336859/javascript-var-functionname-function-vs-function-functionname

posted on 2010-10-12 09:02  吴义法  阅读(243)  评论(0编辑  收藏  举报