var foo = function () { console.log("foo1") } foo() var foo = function () { console.log("foo22") } foo() function foo() { console.log("foo1") } foo() function foo() { console.log("foo2") } foo()