Design comparison
SolutionDesign
Solution retrospective
What are you most proud of, and what would you do differently next time?
Pleas write my mistakes and give feedback
Community feedback
- @0xabdulkhaliqPosted 7 months ago
Hello there 👋. Congratulations on successfully completing the challenge! 🎉
- I have a suggestion 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
let form = document.querySelector('form') let card_number = document.getElementById('card-number') let card_name = document.getElementById('card-name') ....
- instead try this,
let form = document.querySelector('form'), // Add commas (,) after each declarations card_number = document.getElementById('card-number'), card_name = document.getElementById('card-name'), ••• ••• // n number of declarations input_cvc = document.getElementById('input-cvc'); // 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
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