Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
像这样声明 Javascript 函数有什么区别:
function myName(...)
像这样:
var myName = function(...)
我不相信,但是...
第一个是函数声明 ,你给它起了名字。 它将被吊起。
第二个是函数表达式 你写它的方式,它是匿名的。 它仅在定义它的行之后可用。