There is a view loop

filter.mat.some(fw => { if (message.content.includes(fw)) { // Код } } 

If the message.content contains two words from the fw line, the cycle is triggered several times. I need to limit the number of loop executions, namely, to 1. How can I do this?

    1 answer 1

    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some

     filter.mat.some(fw => { if (message.content.includes(fw)) { // Код return true; // !!! } }