not sure why this isn't working for me , i have a script embedded into about 100 different third party sites , each of those sites prints a var in its page source to determine its uniqueID
The var printed to each page is
var league_id = '43570';
the 5 digit number changes depending on the league_id for that site.
I want to execute a function for certain sites that have a league_id The following works fine , but my list may be 100 or more league_id
if ( league_id === '43570' || league_id === '10065' ) {
console.log(league_id + " League Validated");
} else {
console.log(league_id + " League Not Validated");
}
So i wanted to place in an array , but my below 2 efforts have failed
if ([43570,10065,61,3902].indexOf(league_id) > -1) {
console.log(league_id + " League Validated");
} else {
console.log(league_id + " League Not Validated");
}
if([43570,10065,61,3902].includes(league_id)) {
console.log(league_id + " League Validated");
} else {
console.log(league_id + " League Not Validated");
}