diff --git a/lib/badwords.js b/lib/badwords.js index f93953e..160f9a7 100644 --- a/lib/badwords.js +++ b/lib/badwords.js @@ -79,7 +79,8 @@ var Filter = (function () { */ Filter.prototype.addWords = function addWords() { let words = Array.from(arguments); - this.list = this.list.concat(words); + + this.list.push(...words); words.forEach(function (word) { if (!!~this.exclude.indexOf(word)) { @@ -93,8 +94,7 @@ var Filter = (function () { * @param {(string|string[])} word - Word to add to whitelist. */ Filter.prototype.removeWords = function removeWords() { - let words = Array.from(arguments); - this.exclude.push.apply(this.exclude, words); + this.exclude.push(...Array.from(arguments)); }; return Filter;