has

Object
since 0.1.0

Arguments

  • Object The object to query.
  • Array|string The path to check.

Returns

boolean `true` if `path` exists, else `false`.

Checks if path is a direct property of object.

Example of Lodash _.has

var object = { 'a': { 'b': 2 } };
var other = _.create({ 'a': _.create({ 'b': 2 }) });

_.has(object, 'a');
// => true

_.has(object, 'a.b');
// => true

_.has(object, ['a', 'b']);
// => true

_.has(other, 'a');
// => false