SoumeyaH/coding_quiz

Homework improvements

Opened this issue · 0 comments

HTML

<!-- <meta charset="UTF-8" />

Big chunk of commented code, best just to delete if unneeded.

<main class="main-container" id="main-container">

Not really any need to give an element the same id and class name, one or the other would do, and you can style and target an element in JS with either an ID or a class

SCRIPT

} else if (timeLeft === 1) {

Rather than have an else if here, on line 154 you could just check if timeLeft is >= (greater or equal to) 1 (as both blocks do the same thing)

const getHighScoreFromLocal = () => {

No need for this function. You are returning highscore but you are not actually doing anything with that returned value

window.location.assign("../../highscores.html");

This link is broken. You are backing up to far with the '../../', I think all you need here is just './highscores'

HIGHSCORES

highScoresContainer.textContent = "";

Really tiny point but you can just do this in your noHighScores func as this is responsible for setting the content of highScoresContainer. Remember ideally you want a function to concentrate on just doing one job