right now I have:
if (breadCrumbArr[x] !== 'NEBC' && breadCrumbArr[x] !== 'station:|slot:' && breadCrumbArr[x] !== 'slot:' && breadCrumbArr[x] !== 'believe') {
// more code
}
But I think this could be done better...
Make an array and use indexOf
:
['NEBC', 'station:|slot:', 'slot:', 'believe'].indexOf(breadCrumbArr[x]) === -1
You could use a switch
statement:
switch(inputString){
case "ignoreme1":
case "ignoreme2":
case "ignoreme3":
break;
default:
//Do your stuff
break;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With