You could check every option.
if (compare === "page1" || compare === "page2") {
Or you could use an array and check with an existential quantifier like Array#some
against, like
if (["page1", "page2"].some(a => a === compare)) {
var compare = "page3";
if (compare === "page1" || compare === "page2") {
document.body.innerHTML = "github url";
} else {
document.body.innerHTML = "non-github url";
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…