Sometimes, we want to fix getFullyear() is not a function with JavaScript.
In this article, we’ll look at how to fix getFullyear() is not a function with JavaScript.
How to fix getFullyear() is not a function with JavaScript?
To fix getFullyear() is not a function with JavaScript, we should be called getFullYear
instead.
For instance, we write
const start = new Date();
const y = start.getFullYear();
to call start.getFullYear
to return the 4 digit year number of the start
date.
Conclusion
To fix getFullyear() is not a function with JavaScript, we should be called getFullYear
instead.