getFullYear within moment in angular 1

getFullYear within moment in angular

 alert((new Date()).getFullYear());

Here is what the above code is Doing:
1. We create a new Date object and call its getFullYear() method.
2. We pass the result of getFullYear() to the alert() function.
3. The alert() function displays the result in a message box.

Similar Posts