Js

Learning about [OO programming](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript) in Javascript.
I think the first way I wrote this was a little confusing, since it's becoming unclear whether there are two or three things I'm checking for so I tried rewriting it. Three cases are:

1. User passes in nothing, which should return random phrase
2. User passes in index that's within range, which returns phrase at that index
3. User passes in index that's not within range, which returns an error

```
if ( typeof i !== 'number' ) {
    console.log( this.name + ' says, "' + phrases[random] + '"');
} else if ( i === 0 || i < phrases.length ) {
    console.log( this.name + ' says, "' + phrases[i] + '"');
} else {
    console.error('Sorry dude! We ' + "don't" + ' have that many phrases!');
}
```

Otherwise, it'll fail when someone does something like ```raphael.speak()```...