or function

dynamic or(
  1. dynamic value,
  2. dynamic defaultValue
)

JS Patterns

Implementation

dynamic or(value, defaultValue) => falsey(value)
    ? defaultValue is Function
        ? defaultValue()
        : defaultValue
    : value;