Return the millisecond value of an Interval.
intervalToMs(100); // 100intervalToMs({ millis: 100 }); // 100 Copy
intervalToMs(100); // 100intervalToMs({ millis: 100 }); // 100
Use defaultNumber to return a default in the case of undefined or invalid input.
defaultNumber
intervalToMs(undefined); // throws errorintervalToMs(undefined, 100); // 100 Copy
intervalToMs(undefined); // throws errorintervalToMs(undefined, 100); // 100
If no default is provided, an exception is thrown.
Interval
Optional
Default value if interval is undefined or invalid
interval
Milliseconds
Return the millisecond value of an Interval.
Use
defaultNumber
to return a default in the case of undefined or invalid input.If no default is provided, an exception is thrown.