string-similarity icon indicating copy to clipboard operation
string-similarity copied to clipboard

first.replace is not a function

Open ghost opened this issue 4 years ago • 2 comments

All in the title.

ghost avatar Jan 09 '21 17:01 ghost

Similar here, i got "second.replace is not a function" in compareTwoStrings()

Any thoughts?

Edit: My fault, i was passing a null value sometimes, "fixed" adding || "" after the variables

RiccardoManzan avatar Feb 11 '21 17:02 RiccardoManzan

Suggested to update the docs to say that string 1 and string 2 passed to compareTwoStrings() must not be null, or check the vals passed in and throw an error if either null rather than relying on the error throw by null.replace().

ianengelbrecht avatar Aug 12 '21 08:08 ianengelbrecht