I'm trying to make all array indexes lowercase strings, but it's not working. I looked at other answers on here and tried their solutions like using toString()
before adding toLowerCase
but it doesn't work, which is weird.
I created a jsfiddle of the problem here.
JS:
$(colorArr).each(function(i, item) // loop thru each of elements in colorArr and make lowercase + trim
{
if(colorArr[i] !== undefined) // check if colorArr index undefined
{
colorArr[i].toString().toLowerCase().trim(); // FIX HERE
/* TRIED - DIDN'T WORK!
colorArr[i].toLowerCase().trim();
*/
}
});