How to deal with out-of-range values
In 'constrain' mode, out-of-range values are clamped to the nearest in-range value.
'constrain'
In 'reject' mode, out-of-range values will cause the function to throw a RangeError.
'reject'
The default is 'constrain'.