1.0.3 • Published 3 years ago
csget v1.0.3
sget
安全地读取对象的属性
安装
npm install csget --save
使用
var sget = require('csget')
var a = {}
console.log(a.b.c) // TypeError: Cannot read property 'c' of undefined
console.log(sget(a, 'b', 'c')) // undefined
1.0.3
3 years ago