Skip to content

Commit

Permalink
Better example in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
remy committed May 28, 2015
1 parent 435db27 commit 98aa896
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ var object = {
b: {
c: 1,
d: [1,2,3],
e: false
e: 'remy'
}
}
};

console.log(undefsafe(object, 'a.b.e') === false);
console.log(undefsafe(object, 'a.b.e')); // "remy"
console.log(undefsafe(object, 'a.b.not.found')); // undefined
```

Demo: [https://jsbin.com/eroqame/3/edit?js,console](https://jsbin.com/eroqame/3/edit?js,console)

0 comments on commit 98aa896

Please sign in to comment.