<p>I need to decrement a Javascript date by 1 day, so that it rolls back across months/years correctly.  That is, if I have a date of 'Today', I want to get the date for 'Yesterday'.</p>

<p>It always seems to take more code than necessary when I do this, so I'm wondering if there's any simpler way.  </p>

<p>What's the simplest way of doing this?</p>

<p>[Edit: Just to avoid confusion in an answer below, this is a <strong>JavaScript</strong> question, not a Java one.]</p>

```
```
var today = new Date();
var yesterday = new Date().setDate(today.getDate() -1);
```
```