countKeys
The countKeys() method counts the number of an object's keys while ignoring internal keys.
Interactive example
Syntax
typescript
function countKeys<
GenericObject extends object
>(
object: GenericObject
): numberParameters
object: The object whose keys you want to count.
Return value
The number of the object's keys, excluding internal keys.
See also
keys- Returns an array of an object's keysvalues- Returns an array of an object's valuesentries- Returns an array of key-value pairs
