💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
## hasIn + [link](./hasIn "Link to this entry.") + [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L11229 "View in source.") + [npm](https://www.npmjs.com/package/lodash.hasin "See the npm package.") ``` _.hasIn(object, path) ``` 检查 `path` 是否是对象的直接 或者 继承属性。 ### 参数 1. object (Object) 要检索的对象 2. path (Array|string) 要检查的路径 ### 返回值 (boolean) 如果存在返回 true,否则返回 `false` ### 示例 ``` var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); _.hasIn(object, 'a'); // => true _.hasIn(object, 'a.b.c'); // => true _.hasIn(object, ['a', 'b', 'c']); // => true _.hasIn(object, 'b'); // => false ```