Executes a callback if the value exists 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 exists, otherwise undefined
Executes a callback if the value exists and returns the result