变量提升

2019/7/31
foo();

var foo;

function foo() {
    console.log(1);
}

foo = function() {
    console.log(2);
}

function foo(){
    console.log(3);
}

foo();

function foo() {
    console.log(1);
}

function foo(){
    console.log(3);
}

foo();

var foo;

foo = function() {
    console.log(2);
}

foo();
原创文章,持续完善中,转载请注明出处。本文地址: https://www.qinshenxue.com/article/2019-07-31-08-38-37.html