Q:

cannot print the result of a getDay() method

I just started learning Javascript so I was trying to apply the first things I learned to exercise a bit. At first I tried to create a .html file, then link it to an external .js file and write some lines.
More specifically I tried to print on my page the result of applying the getDay() method to the date of today. Here's how I wrote it : 

const now = Date();

const today = now.getDay();

document.write(today);
<html>
    <head>
        <link href="./style.css" type="text/css" rel="stylesheet">
    </head>
    <body>
        <script src="script.js" type=text/javascript></script>
    </body>
</html>

Can someone tell me why my getDay() method won't work? It's not a problem of linking because writing other stuff works.
I'm not looking for a workaround but just an explanation to understand what I am doing wrong.
Thanks a lot in advance !

A:

You have to use the  new operator to create an instance of Date object:

The new operator creates an instance of a user-defined object type or of one of the built-in object types that has a constructor function.

const now = new Date();

const today = now.getDay();

document.write(today);

