_.hasIn(object, path)
Checks if path
is a direct or inherited property of object
.
Since
4.0.0
Arguments
object
(Object): The object to query.path
(Array|string): The path to check.
Returns
(boolean): Returns true
if path
exists, else false
.
Example
var object = _.create({ 'a': _.create({ 'b': 2 }) });_.hasIn(object, 'a');// => true_.hasIn(object, 'a.b');// => true_.hasIn(object, ['a', 'b']);// => true_.hasIn(object, 'b');// => false
当前内容版权归 lodash.com 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 lodash.com .