let a;
console.log(a); //undefined
let e;
console.log(e()); //Error: c is not a function
console.log(b);
let b;
//Error: Cannot access 'a' before initialization
const c = ()=> console.log('fn');
console.log(c); //()=> console.log('fn')
console.log(c()); //undefined 打印‘fn’
const d; //
Error: Missing initializer in const declaration
test():
function test()
{
alert('1')
} // 整个函数体提升test()位置
js变量与函数声明与使用
最新推荐文章于 2023-05-17 01:42:25 发布