Checks if the given value is a byte.

Type signature

(x?: unknown) => boolean

Examples

byte(128);
// ⇒ true
Try in REPL
byte(325);
// ⇒ false
Try in REPL
byte(65.5);
// ⇒ false
Try in REPL

Questions

  • How to check if a given value is a byte?
  • How to check if a given number is a byte?

TypeScript sourceJavaScript source