"and will only properly detect string primitives.
+(will fail if a string was created with `new String()`). "

...would be better as something like: "and will only properly detect string primitives: for example, it will fail if a string was created with `new String()`."

It's also unclear what "fail" means - "always return false", or something else?