Create a gist now

Instantly share code, notes, and snippets.

function guessAvenger(avenger) {
if (avenger.sex ==M&& avenger.age < 80 && avenger.canFly && avenger.skinColor.includes(“white”)) {
console.log(“Iron Man”);
}
else if (avenger.sex ==M&& avenger.age > 1000 && avenger.canFly && avenger.skinColor.includes(“white”)) {
console.log(“Thor”);
}
else if (avenger.sex ==M&& avenger.age < 80 && !avenger.canFly && (avenger.skinColor.includes(“white”) || avenger.skinColor.includes(“green”))) {
console.log(“Hulk”);
}
else if (avenger.sex ==F&& avenger.age < 80 && !avenger.canFly && avenger.skinColor.includes(“white”)) {
console.log(“Black Widow”);
}
else if (avenger.sex ==M&& avenger.age > 80 && avenger.age < 120 && !avenger.canFly && avenger.skinColor.includes(“white”)) {
console.log(“Captain America”);
}
else if (avenger.sex ==M&& avenger.age < 80 && !avenger.canFly && avenger.skinColor.includes(“black”)) {
console.log(“Nick Fury”);
}
else if (avenger.sex ==M&& avenger.age < 80 && avenger.canFly && avenger.skinColor.includes(“black”)) {
console.log(“Falcon”);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment