React’s JS advantage over Vanilla Java Script
Securing the loop against endless execution
Another challenge in the project was to ensure that the questions during the quiz were not repeated. Like a simple loop checking whether the object already has the number of the question we want to ask, but finally, I got a little tired with this topic.
The code had to be looped so that it would always execute when the question was duplicated. On the other hand, it was necessary to prevent the code from running forever. In the end, it turned out like this:
Graphically, the project isn’t complicated and the only know-how is to use an additional CSS class to set the display: none property; in conjunction with the JS code adding and removing this class from the css file.
This week I spent a total of 20 hours on programming, of which 18 hours was spent preparing a quiz, the source code of this project is available at: FrontendQuiz