var d = getDay();
It won't take any parameters and just provides the weekday. If the day is Monday then 1 will be provided, if Tuesday then 2 will be provided and so on.
In the following example, using the date object and its method getDay() the weekday of the day is calculated. The day of the operation of my code is Monday. So the output executed is 1.
<html> <body> <script> var d = new Date(); document.write(d.getDay()); </script> </body> </html>
<html> <body> <p id = "day"></p> <script> var d = new Date(); document.getElementById("day").innerHTML = (d.getDay()); </script> </body> </html>