Get the current year in Javascript

Was trying to figure out how to get the current year value ie. 2021 using Javascript. Below is the quickest way I could find to get it

$end_value = (new Date()).getFullYear() ;

Justin Kelly

Justin Kelly

Data Engineeer, Business Analytics, Web Developer, Library Technology specialising in PHP and Tableau

Based in Melbourne, Australia

Feel free to contact me or _justin_kelly