This repository has been archived on 2026-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
todo/server/node_modules/undefsafe/example.js

15 lines
245 B
JavaScript
Raw Normal View History

2025-06-13 06:04:40 +00:00
var undefsafe = require('undefsafe');
var object = {
a: {
b: {
c: 1,
d: [1, 2, 3],
e: 'remy'
}
}
};
console.log(undefsafe(object, 'a.b.e')); // "remy"
console.log(undefsafe(object, 'a.b.not.found')); // undefined