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

Interactive rating component using JavaScript

@nachtwurst

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


This was my first time using JavaScript. :) I'm not sure about my use of "var" variables in my JavaScript. I've read that you shouldn't really use them, but since "let" and "const" are immutable, I wasn't really sure how to use them for the variables I needed.

Community feedback

John Mirage 1,590

@john-mirage

Posted

var:

  • function-scoped or globally-scoped
  • can be reassigned

let:

  • block-scoped
  • can be reassigned

const:

  • block-scoped
  • cannot be reassigned
  • if a constant is an object, its properties can be updated or removed.
  • if a constant is an array, its items can be updated or removed.

Marked as helpful

1

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