Example 1 — Official: Own Top-Level Key
A direct own property returns true.
var object = { a: { b: 2 } };
console.log(_.has(object, "a")); // true How It Works
- Object. Has its own key
a. - Path. Simple string
'a'. - Result.
true— matches the official docs. - Tip. This does not read the value — only existence.

