What I want to do is use a variable with window.location.href.indexOf() This is my code right now, I want to be able to shorten it.
var urls  = [
'https://www.example.com/' 
,'https://www.example2.com/' 
,'https://www.example3.com/'  
,'https://www.example4.com/'
,'https://www.example5.com/'
];
// if ((window.location.href.indexOf(""+urls+"") > -1) Does not work
if (
(window.location.href.indexOf("https://www.example.com/") > -1)
|| (window.location.href.indexOf("https://www.example2.com/") > -1)
|| (window.location.href.indexOf("https://www.example3.com/") > -1)
|| (window.location.href.indexOf("https://www.example4.com/") > -1)
|| (window.location.href.indexOf("https://www.example5.com/") > -1)   
) {
//do stuff
}
I've included what I've tried in the code but it doesn not work. javascript and jquery both work for me
 
     
     
     
     
    