01 Ocak 2023



Quiz Hero Blog


The differences are:
1. map: Map takes a callback and run it against every element on the array and generates a new array based on existing array.
2. forEach: forEach works as a loop to work over the array and provides array elements to work on them.
3. filter: filter works like forEach but it also checks return value that if the element is true or false to send a final result by removing the element.
4. find: find works like filter but it only return first matching value given by condition.

The differences are:
1. Local Storage: Local storage data is stored for a lifetime unless the user manually deletes it from the browser.
2. Session Storage: Session storage data persist in the browser until its current tab is on. If the tab is closed or browser is terminate then the data is lost.
3. Cookie: Cookies saves user information on the webpage. When the connection to webpage is disconnected the user information is stored in web server remains and can be access by user later.

The event loop is single threaded. It is a process that waits for the CallStack to be clear before pushing callbacks from the Task Queue to the Call Stack. Once the Stack is clear event loop triggers and checks the Task Queue for available callbacks. If there area any, it pushes it to the Call Stack, waits for the Call Stack to be clear again, and repeats the same process.

The "quizTimer()" function counts the time that a user takes to complete the quiz and shows in the UI. This function has minute and second. It is set to start from 1 second. It converts result to string to save in local storage.

This function selects the answers from the questions. Then it shows in the UI. It is showed with selected answers with unselected options. It maintains serials similar to quiz questions.

Hiç yorum yok:

Yorum Gönder

Yorumunuz en kısa sürede yayınlanacaktır.