This question already has an answer here:
iam making a simple quiz app in which if you answer a question correctly your score will get incremented by 1. but the bug is even though you type correct answer your score isn't incrementing i'll paste one question as an example but this is not working for all of my questions. any help is greatly appreciated, thanks!
var score = 0;
var question1 = prompt("which programming language has a gem in it's name?");
if(question1.toLowerCase === 'ruby'){
score++; //not increasing
}
document.write(score); //printing zero even though the answer is correct
Aucun commentaire:
Enregistrer un commentaire