Just playing around with some EventListeners

WOW I went in and commented out those unneeded variables and the code started working perfectly! :sweat_smile:

How could just having those variables sitting there be effecting the code like that??? Im so confused, but super happy that it works now!

How could those variable have been effecting the page like that. They were unused and just sitting there!? but I guess some how they were working in the code??? WILD :crazy_face:

The line above actually assigned the value CadetBlue to the body’s background (the part inside the parentheses). After this line, the variable allBlue contains the string "CadetBlue".

1 Like

Oh ok I see… I was under the impression that after the var, const or let declaration that the line of code after the declaration and assignment is all contained into the variable itself.

Now I know. Thank you so much for your help, I really appreciate it greatly :pray:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.