Finds the key within the top level of the source object, or returns defaultValue
name | type | arguments | description |
---|---|---|---|
source | object |
The object to search |
|
key | string |
The key for the property on source. Must exist at the top level of the source object (no periods) |
|
defaultValue | * | <optional> |
The default value to use if the key does not exist. |
The value if found; otherwise, defaultValue (null if none provided)