+ 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>

11th Oct 2018, 8:37 PM
Adebayo David Kismet
Adebayo David Kismet - avatar
3 Answers
0
<html> <head> </head> <body> <img src="ĂĄrbol.jpg" </body> </html> me sale cortado que puedo hacer
12th Oct 2018, 6:28 PM
Juan Calderon
Juan Calderon - avatar
- 1
in javascript we have two types of code to output a code on the screen,right? document.write(); console.log();
13th Oct 2018, 6:16 AM
joachim
joachim - avatar