Executes a callback if the value is defined and returns the result
The type of the value
The callback function to execute that returns a value
Optional
The value to check (optional)
The result of the callback if value is defined, otherwise undefined
Executes a callback if the value is defined and returns the result