Skip to content
This repository has been archived by the owner on Mar 11, 2018. It is now read-only.

Commit

Permalink
Change returned value on invalid access from null to undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanqing committed Aug 11, 2014
1 parent f184719 commit 8c84b7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ var obj = {
jaunt(obj, 'foo.bar.0'); //=> "Hello"
jaunt(obj, ['foo', 'bar', 1]); //=> "World"

jaunt(obj, 'invalid'); //=> null
jaunt(obj, 'invalid'); //=> undefined
```

## API

### jaunt(obj, path)

Returns the value in `obj` corresponding to `path`. Returns `null` if `path` does not exist.
Returns the value in `obj` corresponding to `path`. Returns `undefined` if `path` does not exist.

- `obj` is an `object` or an `array`.
- `path` is a dot-delimited `string` or an `array` of keys.
Expand Down

0 comments on commit 8c84b7c

Please sign in to comment.