finki-main
main
|
Last change
on this file since 62b2964 was 81bc7da, checked in by Klimentina Efremova <klimentina08642@…>, 3 months ago |
|
Initial commit
|
-
Property mode
set to
100644
|
|
File size:
245 bytes
|
| Line | |
|---|
| 1 | var undefsafe = require('undefsafe');
|
|---|
| 2 |
|
|---|
| 3 | var object = {
|
|---|
| 4 | a: {
|
|---|
| 5 | b: {
|
|---|
| 6 | c: 1,
|
|---|
| 7 | d: [1, 2, 3],
|
|---|
| 8 | e: 'remy'
|
|---|
| 9 | }
|
|---|
| 10 | }
|
|---|
| 11 | };
|
|---|
| 12 |
|
|---|
| 13 | console.log(undefsafe(object, 'a.b.e')); // "remy"
|
|---|
| 14 | console.log(undefsafe(object, 'a.b.not.found')); // undefined
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.