Skip to content

isString() function

Returns true if s is a String.

Signature:

typescript
isString: <T>(input: T) => input is T & string

Example

ts
isString("a"); // true
isString(2); // false

Open Source Code

Released under the Apache-2.0 License.