Skip to main content
Version: 1.0.2

is.char

is.char(target: unknown)โ€‹

Specificationโ€‹

  • Target argument: required.
  • Checks if the given "target" type is char.

Informationโ€‹

  • Unit tests: โœ…

Examplesโ€‹

is.char(`a`); // true
is.char("r"); // true
is.char('t'); // true
is.char(`3`); // true
is.char(`1`); // true
is.char(`2`); // true

is.char('hello'); // false
is.char('hello123'); // false
is.char('helloWorld'); // false
is.char('a1B2c3d4e5f6g'); // false
is.char('a1B2c3d4e5f6'); // false
is.char('inCamelCase'); // false
is.char('undefined'); // false
is.char('null'); // false
is.char(BigInt(1)) // false
is.char(0) // false
is.char(1) // false
is.char(-1) // false
is.char(Symbol()) // false
is.char(null) // false
is.char(true) // false
is.char([]) // false
is.char(false) // false
is.char("") // false
is.char('') // false
is.char(``) // false
is.char({}) // false
is.char(undefined) // false
is.char(Function) // false
is.char(() => {}) // false
is.char(BigInt) // false
is.char(Symbol) // false
is.char(NaN) // false
is.char(Infinity) // false
is.char(-Infinity) // false
is.char(Number.POSITIVE_INFINITY) // false
is.char(Number.NEGATIVE_INFINITY) // false
// And all other known types will return false

Reversal boolean resultโ€‹

is.char(`a`); // false
is.char("r"); // false
is.char('t'); // false
is.char(`3`); // false
is.char(`1`); // false
is.char(`2`); // false

is.not.char('hello'); // true
is.not.char('hello123'); // true
is.not.char('helloWorld'); // true
is.not.char('a1B2c3d4e5f6g'); // true
is.not.char('a1B2c3d4e5f6'); // true
is.not.char('inCamelCase'); // true
is.not.char('undefined'); // true
is.not.char('null'); // true
is.not.char(BigInt(1)) // true
is.not.char(0) // true
is.not.char(1) // true
is.not.char(-1) // true
is.not.char(Symbol()) // true
is.not.char(null) // true
is.not.char(true) // true
is.not.char([]) // true
is.not.char(false) // true
is.not.char("") // true
is.not.char('') // true
is.not.char(``) // true
is.not.char({}) // true
is.not.char(undefined) // true
is.not.char(Function) // true
is.not.char(() => {}) // true
is.not.char(BigInt) // true
is.not.char(Symbol) // true
is.not.char(NaN) // true
is.not.char(Infinity) // true
is.not.char(-Infinity) // true
is.not.char(Number.POSITIVE_INFINITY) // true
is.not.char(Number.NEGATIVE_INFINITY) // true
// And all other known types will return true