My browser does not execute my JavaScript code. I want to be able to preview my work in my browser but the browser just outputs the code as I wrote it in the text editor. I am currently learning JavaScript and it is really important that I can test-run my code.

I have tried using different browsers including Chrome, Firefox and Internet Explorer. Javascript is enabled on all of them. I also tried modifying the settings in my text editor. In Visual Studio code, it seems to be executing in "powershell" and when I tried to open in chrome, it just outputted the code as it was in the text-editor. I have aso tried using Sublime text and Atom but the `result is the same; my Javascript code fails to run but the HTML and CSS run perfectly.`

I expect that when I "run active file" or "view in browser" in Visual Studio Code and Atom respectively, my browser would execute my Javascript code not return the code the way it is on the text editor.

enter code here

```
    function calc() {
        var num1 = prompt("Enter a number");
        var num2 = prompt("Enter another number");
        var sum = Number(num1) + Number(num2);
        alert(sum)};
    calc();

enter code here

    </div>
<script type="text/js" src="script.js"></script>
</body>

```