Saturday 15 April 2017

Give my javascript array access to includes()

Before everything, I have been making a word filter program for my discord.js bot so excuse me for the bad words!

Since you can't add extra parameters in includes() I decided to make a var line:

var filteredwords = ['asshole', 'fuck']

But now I want to place these words (further more will be added) in the following code line:

if (message.content.includes('asshole'));

So instead of 'asshole' I want to place the array? How can I do that? Since I'm a beginner in JS I could not understand the other topics with a similar question. It would be fine if you explain it in noob language. :)



via M. Kaçiran

No comments:

Post a Comment