I have no idea what is happening here. The code is:

```
  if( true ) { 

      console.log('In first function definition');

      function test(){
        console.log('Hello world');
      }

    } else {

      console.log('In the second function definition');

      function test(){
        console.log('Goodbye world');
      }

    }

  test();

```

I would expect this to log in the console:

```
'In the first function definition'
'Hello world'

```

But instead it logs:

```
'In the first function definition'
'Goodbye world'

```

How is the second named function being created when the code doesn't enter that branch?