You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, although I think the frontend code is pretty solid, I'd like to make a suggestion about where to ideally place your variables. At the moment, they're just hanging out in the global namespace. In future if people were to add to this code, or add extra JS files for instance, you might find that the variables conflict with eachother. Ideally, variables should be scoped to within the function they're being used in to avoid this happening. It also makes your code easier to read by being more modular - as you can see where and how things are being used, and take things in and out of your code as you see fit.
The text was updated successfully, but these errors were encountered:
So, although I think the frontend code is pretty solid, I'd like to make a suggestion about where to ideally place your variables. At the moment, they're just hanging out in the global namespace. In future if people were to add to this code, or add extra JS files for instance, you might find that the variables conflict with eachother. Ideally, variables should be scoped to within the function they're being used in to avoid this happening. It also makes your code easier to read by being more modular - as you can see where and how things are being used, and take things in and out of your code as you see fit.
The text was updated successfully, but these errors were encountered: