Validate an integer
The raw input
isInteger(1) >> { valid: true, parsed: 1, }; isInteger(0.5) >> { valid: false, error: "Not an integer: 0.5", }; Copy
isInteger(1) >> { valid: true, parsed: 1, }; isInteger(0.5) >> { valid: false, error: "Not an integer: 0.5", };
Validate an integer