source: node_modules/undefsafe/example.js@ 2d1ec46

main
Last change on this file since 2d1ec46 was 81bc7da, checked in by Klimentina Efremova <klimentina08642@…>, 3 months ago

Initial commit

  • Property mode set to 100644
File size: 245 bytes
RevLine 
[81bc7da]1var undefsafe = require('undefsafe');
2
3var object = {
4 a: {
5 b: {
6 c: 1,
7 d: [1, 2, 3],
8 e: 'remy'
9 }
10 }
11};
12
13console.log(undefsafe(object, 'a.b.e')); // "remy"
14console.log(undefsafe(object, 'a.b.not.found')); // undefined
Note: See TracBrowser for help on using the repository browser.