JSFiddle - React, Tailwind, and code Playground
JavaScript
var answer = 0,
quesAns = [
["The song bullet is from what arist?", "HOLLYWOOD UNDEAD"],
["The song date rape is by what artist?", "SUBLIME"],
["The song behind blues eyes is by what artist?", "LIMP BIZKIT"],
["The song welcome is by what artist?", "FORTMINOR"],
["The song the one is by what artist?", "DUCE"]
];
for (var i in quesAns) {
var response = prompt(quesAns[i][0]);
if (response.toUpperCase() === quesAns[i][1]) {
answer += 1;
}
}
if (answer === 5) {
alert(" you get gold crown");
} else if (answer >= 3) {
alert(" You get silver crown");
} else if (answer >= 1) {
alert(" you get bronze crown");
} else {
alert(" Loser");
}