Seth M. answered 02/07/20
Expert help with Python, Java, JavaScript, C++, Philosophy, and Logic
There are add-on libraries that perform this. One interesting attempt to do this without an add-on library can be found here: https://codepad.co/snippet/javascript-calculating-similarity-between-two-strings. It attempts to employ a Levenshtein distance calculation, which is effectively what you are seeking.
One very simple approach to this might involve stripping out white spaces, converting everything to lowercase, then summing and comparing the ascii values of the content of the strings. The closer the sum, the more (likely) similar the two strings are. This could be augmented by taking the character-by-character content of the smaller string, removing that from the larger string, comparing the difference, etc.
The L-D version is pasted, below, in the event that the codepad snippet is deleted: