Js

Learning about [OO programming](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript) in Javascript.
There are a couple of ways, first let's go through safe was to check if `i` was provided

You could do:
```
i === undefined
typeof i === 'undefined'
arguments.length === 0
typeof i !== 'number'
isNaN(i) === false
```
You could use any of these methods to provide a default value for `i`. Personally, I'm in favor of defaulting to random if the value isn't a number, since you rely on `i` to retrieve the index of an array. You could use `isNaN` or `typeof`; I like `typeof` because it's a bit clearer, and `isNaN` is esoteric to some people.

```javascript
if (typeof i !== 'number') {
    i = Math.floor(Math.random() * (phrases.length));
}

if ( i > phrases.length  || i < 0 ) {
    console.log('Sorry dude! We ' + "don't" + ' have that many phrases!');
} else {
     console.log( this.name + ' says, "' + phrases[i] + '"');
}