Home »
MCQs »
JavaScript MCQs
Which method is used to get the year of a date as a four-digit number?
77. Which method is used to get the year of a date as a four-digit number?
- getYear()
- fullYear()
- getFullYear()
- getfullyear()
Answer: C) getFullYear()
Explanation:
The getFullYear() method is used to get the year of a date as a four-digit number.