Stability: 0 - Deprecated: Use typeof value === 'string' instead.

    • object {any}
    • Returns: {boolean}

    Returns true if the given object is a string. Otherwise, returns false.

    1. const util = require('util');
    2. util.isString('');
    3. // Returns: true
    4. util.isString('foo');
    5. // Returns: true
    6. util.isString(String('foo'));
    7. // Returns: true
    8. util.isString(5);
    9. // Returns: false