JavaScript/立即调用函数表达式:修订间差异
来自康健生活
| 第46行: | 第46行: | ||
2 | 2 | ||
</pre>}}}} | </pre>}}}} | ||
=== | === 可读性 === | ||
=== undefined === | |||
在函数体内部,undefined 会被赋值。 | |||
{{leftrightflex|<syntaxhighlight lang="javascript"> | |||
function foo(){ | |||
var undefined = []; | |||
console.log(typeof undefined); | |||
console.log(undefined); | |||
} | |||
foo(); | |||
</syntaxhighlight>|{{consoleout|<pre>object | |||
[] | |||
</pre>}}}} | |||