Select Page

This first a most simple way to that is using the include function:

var returnde = "Hello";
if(returned.includes("REFCAT") && returned.includes("DEFAULT")) { // true
console.log('show user');
}

But we need to bear in mind that this method is not supported by IE.

The second way a most supported method by browsers is to use indexOf function:

var returnde = "Hello";
if(returned.indexOf("REFCAT") == -1 && returned.indexOf("DEFAULT") == -1 ) { // true
console.log('show user');
}