Javascript – RegExp variable gives boolean result, but giving variable name in array instead of boolean value
I need an array with the boolean values, but instead, it gives me the variable name. Here is a simplistic example: I declare variable to check for match to other data, gives boolean results. var usatest = new RegExp("USA").test(continent); //this…