Javascript Date Question 2

Introduction

Output what day of the week of a given date.

let days = ["Sunday", "Monday", "Tuesday", "Wednesday", 
            "Thursday", "Friday", "Saturday"]; 

let year = 2020; 
let month = 3;//March 
let date = 12; 

console.log(//your code here);



let days = ["Sunday", "Monday", "Tuesday", "Wednesday", 
            "Thursday", "Friday", "Saturday"]; 

let year = 2020; 
let month = 3;//March 
let date = 12; 

let birthDate = new Date(year, month - 1, date); 

console.log(days[birthDate.getDay()]); 



PreviousNext

Related