fix(levenshteinDistance): repair code block

This commit is contained in:
Oskar Grunning
2019-02-26 20:03:50 +01:00
parent e1d6a8f9af
commit 23f39ea097

View File

@ -5,7 +5,7 @@ Calculates the [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_
Calculates the number of changes (substitutions, deletions or additions) required to convert `string1` to `string2`. Calculates the number of changes (substitutions, deletions or additions) required to convert `string1` to `string2`.
Can also be used to compare two strings as shown in the second example. Can also be used to compare two strings as shown in the second example.
``` js ```js
const levenshteinDistance = (string1, string2) => { const levenshteinDistance = (string1, string2) => {
if (string1.length === 0) return string2.length; if (string1.length === 0) return string2.length;
if (string2.length === 0) return string1.length; if (string2.length === 0) return string1.length;