Validate and cast an input
The validated type
The validator to convert
if (guard(isNumber, input)) { // input is treated as a number in this block } Copy
if (guard(isNumber, input)) { // input is treated as a number in this block }
Validate and cast an input