Skip to content

isEven

The isEven function checks if a number is even.

Syntax

typescript
isEven(value)

Parameters

NameTypeDescription
valuenumberNumber to be checked.

Return Value

TypeDescription
booleantrue if the number is even, else false.

Examples

typescript
isEven(4); // true
isEven(7); // false

Notes

  • Throws a TypeError if the value is not a number.
  • Useful for mathematical and logical validations.

References

Released under the MIT License.