This will create a Date exactly one year in the future with just one line. First we get fullYear from a new Date , increment it, set new Date as the year. You might think that we will do this, but if we stop, it will return a timestamp, not a Date object, so we will end all of this in the Date constructor.
new Date(new Date().setFullYear(new Date().getFullYear() + 1))
JP DeVries Mar 14 '15 at 17:32 2015-03-14 17:32
source share