prompt loads before anything else

hay if anybody understand why is prompt showing up even before the console printing
i appreciate the help

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>promptheadache</title>
</head>

<body>
    <script>
    
        console.log('i should appear first on the console')

        var promptInput = prompt('I'm am here befor anything else')

    </script>
</body>

</html>