Skip to content

isString

isString(x): x is string

Checks if x is a string.

Example

isString("foobar")
// => true
isString(1234)
// => false
isString({})
// => false

Parameters

x

unknown

The value to check.

Returns

x is string

true if x is a string, false otherwise.