the-tip-top-backend/node_modules/undefsafe/example.js
soufiane fc67cf6415
All checks were successful
the-tip-top-backend/pipeline/head This commit looks good
push
2025-10-24 14:14:46 +02:00

15 lines
245 B
JavaScript

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