标签:
在Javascript中,函数总是会有一个返回值。即使我们没有显示的使用 “return”,程序也会隐式的返回一个 “undefined”。
通过下面的小demo即可理解。
demo1
function fn(){ return 1; } fn();
运行结果:1
demo2
function fn(){ console.log(1); } fn();
运行结果:1
undefined
标签:
原文地址:http://www.cnblogs.com/AlexCP/p/5974919.html