What is the output?

<! DOCTYPEhtml>    
<html lang="en">    
<head>    
    <meta charset="UTF-8">    
    <title>Js scope, variable promotion interview questions</title>  
</head>    
<body>  
<script type="text/javascript">
var name = 'World! ';
(function () {
    if (typeof name === 'undefined') {
        var name = 'Jack'
        console.log('Goodbye ' + name)
    } else {
        console.log('Hello ' + name)
    }
})()
</script>      
</body>    
</html>
Copy the code

The result: Goodbye Jack