Skip to main content

isString

Checks if the given value is a string.

parametertypedescription
valueunknownThe value to check

Returns boolean: True if the value is a string, false otherwise.

Example

is-string.js
import { isString } from "@sinequa/atomic";

console.log(isString(null)); // Output: false
console.log(isString(undefined)); // Output: false
console.log(isString(42)); // Output: false
console.log(isString("test")); // Output: true
console.log(isString([])); // Output: false
console.log(isString({})); // Output: false