Open bharat-dussa opened 4 weeks ago
hasKey
Checks if an object contains a specific key.
File: src/utils/object/hasKey/hasKey.ts Test File: src/utils/object/hasKey/hasKey.test.ts
src/utils/object/hasKey/hasKey.ts
src/utils/object/hasKey/hasKey.test.ts
Parameters:
obj: object
key: string
Returns:
boolean
true
false
Example:
hasKey({ a: 1, b: 2 }, 'a'); // true hasKey({ a: 1, b: 2 }, 'c'); // false
"I'd love to assist with this issue—what are the next steps?"
hasKey
Checks if an object contains a specific key.
File:
src/utils/object/hasKey/hasKey.ts
Test File:src/utils/object/hasKey/hasKey.test.ts
Parameters:
obj: object
: The object to check.key: string
: The key to look for.Returns:
boolean
: Returnstrue
if the object contains the key, otherwisefalse
.Example: