Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 3 months ago

Frontend Quiz

sass/scss
P
Emmanuel Lopez•550
@EmLopezDev
A solution to the Frontend Quiz app challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

I am proud of the fact that I didn't give up and pushed through finishing the challenge even in moments were I felt it sucked. There were moments were in trying to fix one issue or add a functionality I broke something that was working. Working through those moments were hard but at the same time satisfying because it thought me how things are working and how to prevent this from happening in the future. Learning how to make JS modular was interesting I still don't fully get it but I will look more into it. Creating a toggle switch was fun and also adding light/dark theme. One thing I would do differently is planning a little more ahead of time before even starting to code. I find myself sometimes fumbling certain things because I wasn't prepared for it, like light/dark theme. I wasn't sure if I was going to add it until well after I created a bunch of components. I then had to go back and make adjustments to fit the addition of light/dark theme.

What challenges did you encounter, and how did you overcome them?
  • Creating a toggle switch was bit of a challenge but I watched a few tutorials and was able to get it to work.
  • Setting up light/dark theme was only a challenge because I added it after creating some of the component which then required me to update some of them to get it to work. Now I know to plan for it better from the beginning.
  • Handling so much DOM manipulations became challenging at times because getting one thing to work would sometime break something that was already working. Slowing down and going line by line and diving deep into debugging helped a lot to understand what was going on and how to avoid it for next time.
What specific areas of your project would you like help with?

The three JavaScript files:

  • Was the way I handled all the JS a good approach? What could have made it better?
  • Is there a better way to fetch data and pass it along?
  • Is there a better way to handle a light/dark theme?
  • In general what isn't good and how can I make it better?
Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • P
    kephalosk•400
    @kephalosk
    Posted 3 months ago

    Solid Solution.

    Was the way I handled all the JS a good approach? What could have made it better? --> In general: yes. clean code structure, consts at top, logic below, whitespaces to separate logic, semantic function names.

    Is there a better way to fetch data and pass it along? --> using the fetch-API is totally fine imho.

    Is there a better way to handle a light/dark theme? --> its the common solution to save darkMode state in localSorage and read it where needed

    In general what isn't good and how can I make it better? --> minor things. for example extract logic/code in distributed files, but as soon as you start with frameworks like react you'll do that one day automatically.

    Keep up the good work :)

    Marked as helpful

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit all CSS, SCSS and Less files in your repository.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

How does the JavaScript validation report work?

When a solution is submitted, we use eslint to run an automated check on the JavaScript code.

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub