I have a function that searches through an array of strings. It works perfectly, except for the fact that its case sensitive. I need it to be case insensitive.
The easiest way would be to make the function convert the array to lowercase, so when the function performs a search through the array, it is able to find it, regardless of its case.
I have tried adding var array_name_tolowercase = array_name.toLowerCase(); within my function so that when the function is called, it can work on all arrays; if needed.
Im sorry I haven’t made myself clear at all, if this is the case, please let me know and I will try my best to re-explain. Thanks in advance!
You will need to convert the elements of the array to lower case, not the Array object itself. I don’t know exactly what happens inside your function, but something like this:
Post some more of your code and it will be easier to provide a more precise solution! Here’s an example of the above.