Skip to main content
Version: 2.0.3

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