Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

innerText, textContent, abs&calc, flex-in-flex

Leopoldini 180

@LShiznit

Desktop design screenshot for the Interactive rating component coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Happy to be able to use calc and browser dev tools to center text perfectly. Remembering JS was a challenge.

What are good conventions for naming JS variable vs JS functions? It would be nice to differentiate them by name rather than by brackets or code color.

Community feedback

@fazzaamiarso

Posted

Hello Poldini!

In general, for naming you want the name to be clear and meaningful. Your naming should be understandable without extra mental mapping.

  • for boolean , usually you want to prefix them with is, has, should, etc. EX : isLoading, hasAddress, shouldFetch.
  • you also want the naming easy to understand and meaningful. So, instead of yymmdd for date, you can make it clearer to currentDate,
  • for word casing, the convention is to use camelCase or snake_case (usually for server side)
  • for function, it is better to prefix them with verbs such as append, get, fetch. EX: fetchUser, getResponse.

Here is a resource if you want to dig deeper.

Hope it helps! Cheers!

1

Leopoldini 180

@LShiznit

Posted

@fazzaamiarso This is great. Thank you

0

Please log in to post a comment

Log in with GitHub
Discord logo

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