“Uncaught InternalError: too much recursion” when using Javascript’s standard string.includes( ) method

In Javascript, I am getting a “too much recursion” error in Firefox and Chrome when attempting to perform the following (simplified example):

const results = [];

for (let i = 0; i < 1000; i++) {
   if ("alksdhflasdkhflsakdhflksadjflkdsahf".includes(searchQueryStrippedQuotes)) {
      results.push("match");
   }
}

I get no error when using a short string for searchQueryStrippedQuotes, even there is a large number of results to parse through (bump 1,000 here to 30,000, for instance). However, with a long string (more than 6 or 7 words), I get the error.