Javascript setFullYear
- by user187870
var currentDate=new Date();
currentDate.setFullYear(2011);
alert(currentDate); == this works, it sets the year to 2011 as expected.
alert((new Date()).setFullYear(2011)); == this one doesn't work.
Any idea why? Am I misunderstanding the syntax?