Ask Question
23 May, 11:06

Which of the following statements is NOT a valid way to create a date object named birthday?

var birthday = "12/2/1978";

var birthday = new Date ();

var birthday = new Date ("12/2/1978");

var birthday = new Date (1978, 11, 2);

+2
Answers (1)
  1. 23 May, 13:30
    0
    var birthday = "12/2/1978";

    Explanation:

    It does not create a date object named birthday because in this statement the birthday is a string which contains 12/2/1978 a date it is not date object it is a string. All other three options are correct way to create a date object.

    var birthday = new Date ();

    creates a date object with the current date and time.

    we can also pass date string in the new Date (). So var birthday = new Date ("12/2/1978"); is also correct.

    we can also pass year, month, day in new Date () In this order only. So option fourth is also correct.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Which of the following statements is NOT a valid way to create a date object named birthday? var birthday = "12/2/1978"; var birthday = new ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers