Example 1 — Official: Own Key Check
Return true when the key is defined on the object itself.
_.has({ a: 1, b: 2, c: 3 }, "b");
// → true
_.has({ a: 1, b: 2, c: 3 }, "z");
// → false How It Works
- "b". Present as an own property →
true. - "z". Not on the object →
false. - Safe. Uses Underscore’s internal
hasOwnPropertycall. - Single key. Not a deep path API.

