diff --git a/lib/taskbook.js b/lib/taskbook.js index 39d6594d..b383c61f 100644 --- a/lib/taskbook.js +++ b/lib/taskbook.js @@ -140,15 +140,11 @@ class Taskbook { } _hasTerms(string, terms) { - let result; - - terms.forEach((term, key, arr) => { + for (const term of terms) { if (string.toLocaleLowerCase().indexOf(term.toLocaleLowerCase()) > -1) { - result = (key === arr.length - 1) ? string : ''; + return string; } - }); - - return result; + } } _filterTask(data) {