If you just want to set a default value, it's clearer to either define it *first* or just use || to set it.  E.g.

```javascript
var animation_length_ms = this.states[this.states.length - 1][1]  || 10;
var animation_length_s = (Math.ceil(this.states[this.states.length - 1][1] * 10) / 10000) || 0.2;
```