Skip to content
  • Unlock Pro
  • Log in with GitHub
Profile
OverviewSolutions
25
Comments
1
rafael
@rafaeldevvv

All comments

  • Pedro de Castro Tedesco•190
    @PedrodeCTedesco
    Submitted over 2 years ago

    Responsive landing | nested grids and flex | Media queries

    1
    rafael•550
    @rafaeldevvv
    Posted over 2 years ago

    Hey there! Congratulations on completing the challenge!

    The JS code is good but there are always room for improvement.

    The first thing to note is the use of variables. Consider using "const" to declare a variable instead of "var" or "let" when it is not meant to be reassigned. It can improve code readability and maintanibility. Also, prefer using "let" and "const" over using "var". Declaring variables with "var" can cause some scope bugs. Read more: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#Declarations

    Secondly, you declared variables that hold the same value in different functions. It is better to declare all variables outside both functions and use them inside the functions. This reduces redundancy making the code more readable.

    Thirdly, you are managing each list item when you open or close the menus. I think it would be a better solution to manage the list itself when it is needed to show or hide the items.

    Last, you could use that shortcut, the $ notation, to select DOM nodes to make the code shorter.

    Those are my suggestions for you. Again, congratulations on completing the challenge! Hope I helped! 👍😁

    Marked as helpful

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

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