Returns the value if defined, otherwise the fallback value.
The value to check
The fallback value
The original value or the fallback value
const val = nullishToValue(null, 'default'); // 'default' Copy
const val = nullishToValue(null, 'default'); // 'default'
Returns the value if defined, otherwise the fallback value.