getUTCFullYearbeginnerconst d = new Date('2024-01-15T00:00:00.000Z')
d.getUTCFullYear() // β 2024Use getUTCFullYear() to retrieve the four-digit UTC year of a Date, regardless of local timezone.
Returns the UTC year. Unlike getFullYear(), it is unaffected by the local timezone.
Challenge: Verify that new Date('2024-01-15T00:00:00.000Z').getUTCFullYear() returns 2024.