The object from which to retrieve the value.
The key to use when retrieving the value.
The function to call when the key does not exist in the object. This function should return the default value.
The value associated with the key in the object, or the result of the callback function if the key does not exist in the object.
objGetOrElse({ a: 1, b: 2 }, 'c', (key) => 3);;
//=> 3
V - The type of the values in the object.
Generated using TypeDoc
This function attempts to retrieve a value from an object using a provided key. If the key does not exist in the object, it uses a callback function to generate a default value.