【发布时间】:2017-02-04 15:43:37
【问题描述】:
我正在尝试搜索 Lodash _.get 和 _.has 的 Underscore 等效项,它能够直接访问嵌套对象值的存在和值,而无需检查其父对象的存在。
但是,在我看来,下划线_.get 和_.has 只能检查第一级的值。
var object = { 'a': { 'b': 2 } };
_.has(object, 'a.b'); // lodash shows true
_.has(object, 'a.b'); // underscore shows false
【问题讨论】:
标签: javascript underscore.js lodash