15.1k views
5 votes
If the current date is Monday, February 26, 2017, what will be displayed by the alert dialog box after the following code executes? var thisDay = new Date(); alert(thisDay.toDateString());

User Ibex
by
4.7k points

1 Answer

3 votes

Answer:

Mon Feb 26 2017

Step-by-step explanation:

Since the current date is considered as Monday, February 26, 2017, thisDay will be set to that value.

The toDateString() method returns the first three letters of the name of the day (The first letter is capitalized), the first three letters of the name of the month (The first letter is capitalized), the day of the month as an integer, and the year as an integer (There are spaces between all)

User Titicaca
by
4.7k points