You can create a RegExp from filterstrings first

var filterstrings = ['firststring','secondstring','thirdstring'];
var regex = new RegExp( filterstrings.join( "|" ), "i");

then test if the passedinstring is there

var isAvailable = regex.test( passedinstring );

Here is a test implementation:

// Take care to escape these strings!
// If they are user-input or may contain special regex characters (such as "$" or "."), they have to be escaped.
var filterStrings = ['one','two','three'];
var regex = new RegExp(filterStrings.join( "|" ), "i");

var sentences = [
  "one", // true
  "OnE", // true
  "a rabbit", // false
  "and then two rabbits", // true
  "standing", // false
  "prone", // true
  "AoNeAtWo", // true
];
sentences.forEach(sentence => {
  console.log(
    regex.test(sentence) ? ' match:' : ' not a match:',
    "'" + sentence + "'",
    );
});

Answer from gurvinder372 on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › String › includes
String.prototype.includes() - JavaScript | MDN
This method lets you determine whether or not a string includes another string. The includes() method is case sensitive.
🌐
Bobby Hadz
bobbyhadz.com › blog › javascript-includes-case-insensitive
Make includes() case insensitive in JavaScript | bobbyhadz
To make the String.includes() method case insensitive, convert both of the strings in the comparison to lowercase.
🌐
30 Seconds of Code
30secondsofcode.org › home › javascript › string › case-insensitive substring search
Can I check if a JavaScript string contains a substring, regardless of case? - 30 seconds of code
May 25, 2024 - Instead, you can use a regular expression with the 'i' flag to perform a case-insensitive search. In order to do so, you'll have to use the RegExp() constructor to create a regular expression that matches the given searchString, ignoring the case.
🌐
Javascripts
javascripts.com › perform-case-insensitive-includes-in-javascript
How to Perform Case-Insensitive Includes in JavaScript
June 23, 2023 - Step 3: Use the includes() method to check if the converted target string exists in the converted input string. Step 4: If the target string exists in the input string, it will print “Target string exists in the input string.” If not, it will print “Target string does not exist in the input string.” · In JavaScript, to perform a case-insensitive includes operation, we can leverage the RegExp constructor with the ‘i’ flag.
🌐
Mastering JS
masteringjs.io › tutorials › fundamentals › contains-substring
Check if a String Contains a Substring in JavaScript - Mastering JS
Both String#includes() and String#indexOf() are case sensitive. Neither function supports regular expressions. To do case insensitive search, you can use regular expressions and the String#match() function, or you can convert both the string ...
🌐
Excessivelyadequate
excessivelyadequate.com › posts › mark.html
Case-insensitive Search Term Highlighting With JavaScript
JavaScript’s String.split() function can – instead of a string to split on – also accept a regular expression where each match then yields a split. And, conveniently, JavaScript’s regular expression objects can be created with a case insensitivity flag.
Find elsewhere
🌐
Devsheet
devsheet.com › check-if-array-includes-stringcase-insensitive-javascript
Check if Array includes String(Case Insensitive) Javascript - Devsheet
We will be using the Array.map() and toLowercase() functions to convert all the values of our array to lowercase and then using the indexOf() function we are checking if a string is included in an array ignoring case sensitivity.
🌐
SheCodes
shecodes.io › athena › 37854-how-to-ignore-case-in-javascript
[JavaScript] - How to ignore case in JavaScript? - SheCodes | SheCodes
Learn how to perform case-insensitive comparisons in JavaScript using toLowerCase(), toUpperCase(), and regular expressions with the i flag. ... Is my JS code correct? Is this how I select all the elements h1, h2, footer and p?
🌐
Medium
medium.com › codimis › case-insensitive-string-comparison-in-javascript-b7135f82ae4d
Case-Insensitive String Comparison in JavaScript and TypeScript ...
March 30, 2024 - Learn how to compare strings in a case-insensitive manner in JavaScript and TypeScript using built-in methods like toLowerCase(), toUpperCase(), localeCompare(), and regular expressions with the /i flag. Explore code examples and best practices for case-insensitive string comparison in web development.
🌐
Dirask
dirask.com › posts › JavaScript-string-contains-case-insensitive-1Rv0M1
JavaScript - string contains case insensitive
In this example, we convert whole text string to lowercase, then we search for the word (also in lowercase) to find out if the word is present in the string (true) or not (false).
🌐
Codedamn
codedamn.com › news › javascript
JavaScript includes method for String and Array with Examples
June 2, 2023 - A: The includes() method is case-sensitive. However, you can make it case-insensitive with the help of toLowerCase() or toUpperCase() methods. Convert both the main string and the substring to lower or upper case before using includes().
🌐
W3Resource
w3resource.com › javascript-exercises › javascript-string-exercise-38.php
JavaScript validation with regular expression: Create a case-insensitive search - w3resource
It uses the "search()" method with a regular expression constructed using 'RegExp' with the "i" flag to indicate case insensitivity. If a match is found, it returns 'Matched', otherwise 'Not Matched'.
🌐
GeeksforGeeks
geeksforgeeks.org › compare-the-case-insensitive-strings-in-javascript
JavaScript – Compare the Case Insensitive Strings | GeeksforGeeks
November 26, 2024 - You can use a regular expression with the i flag (case-insensitive) to match strings.
🌐
SourceBae
sourcebae.com › home › case insensitive ‘contains(string)’
Case insensitive 'Contains(string)' - SourceBae
August 21, 2025 - Not all programming languages natively ... (such as String.Contains in C#, includes in JavaScript, or indexOf in Java) are case-sensitive by default....
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › RegExp › ignoreCase
RegExp.prototype.ignoreCase - JavaScript | MDN
RegExp.prototype.ignoreCase has the value true if the i flag was used; otherwise, false. The i flag indicates that case should be ignored while attempting a match in a string. Case-insensitive matching is done by mapping both the expected character set and the matched string to the same casing.