default
default(value, [ctx])
Effect
Set the return value of validate
and validateSilent
, when the detected value is undefined | null
.
Arguments
value
(*) - The default return value ofvalidate
andvalidateSilent
. It is recommended but not necessarily to be a boolean. Whenvalue
is a function, then set the return value ofvalue
to be the default return value. The function has a parameter: the original detected value -undefined
ornull
.[ctx]
(*) - The execution context ifvalue
is a function.
Example
Last updated