How to get the full name of the day of the week? Such code displays the entire date, how can I display only the day?

<script> var date = new Date(); alert(date); </script> 

So you can get the number of the day, and then use if to assign the values ​​of the day.

 var d = new Date(); var n = d.getDay(); 

1 answer 1

old proven way

 var days = [ 'Воскресенье', 'Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота' ]; var d = new Date(); var n = d.getDay(); console.log(days[n]);