Design comparison
Solution retrospective
Hi Everyone!
I made this project in a few hours and I am quite proud of it. I havenΒ΄t written Vanilla JavaScript in a while and it was really fun. I am not sure how I manage to make the Theme switcher. Do you have a better way to do it? Please feel free to indicate it. Any comment will be very welcomed.
Thanks!
Community feedback
- @0xabdulkhaliqPosted over 1 year ago
Hello there π. Congratulations on successfully completing the challenge! π
- I have other recommendations regarding your code that I believe will be of great interest to you.
JAVASCRIPT π‘:
- The way you declared variables are need to be well structured and organized
- Take a look at the following example code which describes a preferable way of declaring variables to have a well structured code, this way can't improve performance but it can increase code readability
const firstName = "Your"; const lastName = "Name"; const emailAddress = "[email protected]"; const password = "supersecret";
- instead try this,
const firstName = "Your", lastName = "Name", emailAddress = "[email protected]" β’β’β’ β’β’β’ // n number of declarations password = "supersecret"; // make sure to add a semicolon at end of last declaration
- This single line declaration with separated commas will helps you to have a better structured code and improves readability though
.
I hope you find this helpful π Above all, the solution you submitted is great !
Happy coding!
Marked as helpful0@NicoDeLaFuentePosted over 1 year ago@0xAbdulKhalid Hi Adbul,
Thank you very much for taking the time to review my code and write some tips about it. I will have this recommendation in mind for the upcoming projects.
Once again, thank you very much and I hope to be in touch soon.
0
Please log in to post a comment
Log in with GitHubJoin 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