+ 3
JavaScript for of loop quiz
<!DOCTYPE html> <html> <head> <title> JavaScript For__of loop</title> </head> <body> <p> pretty cool to loop through Set(),Map() and Array. check out this logic </p> <script> var quiz = [ ["are you learning from sololearn?", "yes"], ["where do you get this code?", "sololearn"], ["who is your best programming language?", "javascript"] ]; var score = 0; for(const [question,answer] of quiz){ var response = prompt(question) if(response===answer){ alert("correct") score++ }else{ alert("wrong!!!") } } console.log("total score"+" "+score); </script> </body> </html>
3 Answers
0
<html>
<head>
</head>
<body>
<img src="ĂĄrbol.jpg"
</body>
</html>
me sale cortado que puedo hacer
- 1
in javascript we have two types of code to output a code on the screen,right?
document.write();
console.log();