function isString
Jump to headingisString(object: unknown): object is string
Deprecated
Returns true
if the given object
is a string
. Otherwise, returns false
.
import util from 'node:util';
util.isString('');
// Returns: true
util.isString('foo');
// Returns: true
util.isString(String('foo'));
// Returns: true
util.isString(5);
// Returns: false
Parameters Jump to heading
Jump to headingobject: unknown
Return Type Jump to heading
object is string