Hello! Need assessment for Image gallery task.
- Source code (github).
- Github Pages.
Hello! Need assessment for Image gallery task.
Hi @VladimirK
Great job on this exercise. Congrats!
For better readability in the “darken/lighten” part I would group the changes in a if...else
statement:
if (btnClass === 'dark') {
/* set three attributes */
} else {
/* set three attributes */
}
It’s a matter of taste. Nothing wrong with your approach.
Have a nice day,
Michael
Hello, @mikoMK! Thank you for the feedback!
I was in doubt about this moment. If it is easier to read the code in the way you said, then I will do so. I think it saves brain resources when the code is simpler.
I wonder what is the best way to handle such situations in terms of browser performance.
Agreed
I wouldn’t think about performance in such simple situations. Unless the code gets executed thousands of times per second. That being said, from a technical perspective my version would probably be better because the conditional will only get evaluated once.