Adds a default return option
If it can't find the value, it will return null by default. However, you can now also pass in a default value of what should be returned if it isn't found.
const world = {
locations: [{
europe: 'Bamberg',
}, {
usa: 'Indianapolis'
}]
};
world.dig('locations', 0, 'europe', 'germany', { default: [] });
// => []
world.dig('locations', 0, 'europe', 'germany', { default: 'not found' });
// => 'not found'
world.dig('locations', 0, 'europe', 'germany', { default: '' });
// => ''