We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2e7e2e7 commit 656b87cCopy full SHA for 656b87c
lib/badwords.js
@@ -79,7 +79,8 @@ var Filter = (function () {
79
*/
80
Filter.prototype.addWords = function addWords() {
81
let words = Array.from(arguments);
82
- this.list = this.list.concat(words);
+
83
+ this.list.push(...words);
84
85
words.forEach(function (word) {
86
if (!!~this.exclude.indexOf(word)) {
@@ -93,8 +94,7 @@ var Filter = (function () {
93
94
* @param {(string|string[])} word - Word to add to whitelist.
95
96
Filter.prototype.removeWords = function removeWords() {
- let words = Array.from(arguments);
97
- this.exclude.push.apply(this.exclude, words);
+ this.exclude.push(...Array.from(arguments));
98
};
99
100
return Filter;
0 commit comments