Categories
JavaScript Answers

How to fix getFullyear() is not a function with JavaScript?

Spread the love

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.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *