I can simplify the condition but not in this way: consider you are trying to acess `get('a string', 'length')`. If checking `typeof data === 'object'`, it returns `false` since `typeof data === 'string'` so I could not access `length` property.

I can change the condition by:
```javascript
// Recursive case: access the field and look into
} else if (data !== null && typeof data !== 'undefined') {
  var field = fields.shift();
  ret = doGet(data[field], fields);
}
```