From 0df38bf62b0cefd1b3069a4144d2694be44a5322 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 26 Feb 2018 17:28:07 +0200 Subject: [PATCH] Update isSimilar.md --- snippets_archive/isSimilar.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/snippets_archive/isSimilar.md b/snippets_archive/isSimilar.md index add2e6c02..7ed53b2ae 100644 --- a/snippets_archive/isSimilar.md +++ b/snippets_archive/isSimilar.md @@ -1,10 +1,10 @@ ### isSimilar -Determines if the `pattern` matches with `str` - -Loops through `str` and determines if it contains all characters of `pattern` and in the correct order. Both the strings are converted to lower case. +Determines if the `pattern` matches with `str`. +Use `String.toLowerCase()` to convert both strings to lowercase, then loop through `str` and determine if it contains all characters of `pattern` and in the correct order. Adapted from [here](https://github.com/forrestthewoods/lib_fts/blob/80f3f8c52db53428247e741b9efe2cde9667050c/code/fts_fuzzy_match.js#L18). + ``` js const isSimilar = (pattern, str) => [...str].reduce(