Ask Question
27 December, 17:42

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. 27 December, 19:32
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers