The value to check
True if the value is a primitive string or a String object, otherwise false
isStringLike(""); // true
isStringLike("abc"); // true
isStringLike(String("abc")); // true
isStringLike(new String("")); // true
isStringLike(Object("abc")); // true
isStringLike(null); // false
isStringLike(undefined); // false
isStringLike(0); // false
isStringLike(["a", "b", "c"]); // false
isStringLike({ length: 1, 0: "a" }); // false (an array-like object)
isStringLike({ toString: () => "abc" }); // false (an object which converts to a string)
Checks if the value is a string, either a primitive string (see isString) or a String object (see isStringObject), eg.
"abc",new String("abc")orObject("abc"). A String object has the length, indexes and functions of its string but it is still an object, so use asString (orvalue.valueOf()) to get the primitive string when one is needed, eg. to compare it using===or to use it as aMapkey.