函数的定义 对象 类型转换

if(function y(){}){console.log(1)}
VM142:1 1
undefined
if(z){console.log(1)}
VM144:1 Uncaught ReferenceError: z is not defined
at <anonymous>:1:1
(anonymous) @ VM144:1
if(function y1(){}){console.log(y1)}
VM148:1 Uncaught ReferenceError: y1 is not defined
at <anonymous>:1:33
(anonymous) @ VM148:1
if(function y1(){}){console.log(typeof y1)}
VM168:1 undefined
undefined

函数的两种定义方式

原文地址:https://www.cnblogs.com/rsapaper/p/8536877.html