-2

I'm learning the basics of web programming. I have this HTML and this .js:

<!--index.html-->
<html>
    <head>
        <title>Client</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    </head>
    <body>
        <script type="text/javascript" src="client.js"></script>
    </body>
</html>

/* client.js */
function currentDate(){
    var now = newDate();
    document.writeln(now.toDateString());
    document.write("hey!");
}

currentDate();

I'm running the index.html on my localhost and it shows nothing. Empty page. What am I missing here? I have no idea what is wrong. I expect it to write out a date and the word "hey!".

Aardo
  • 207
  • 2
  • 11

1 Answers1

5

You are missing a space:

var now = new Date();
AmericanUmlaut
  • 2,729
  • 2
  • 15
  • 26