Board Thread:Code Review/@comment-6475116-20150718222706/@comment-6475116-20150719184905

Vogel100 wrote: I think it needs more variables added to it. Too much long, repeated code.

document.getElementsByClassName('javascript') should be in a variable,

document.getElementsByClassName('javascript')[i].getElementsByTagName('a') should be in a variable,

document.getElementsByClassName('css') should be in a variable,

document.getElementsByClassName('css')[i].getElementsByTagName('a') should be in a variable. I like to limit the number of variables I use in case I need a variable for another script and the less variables the less chance I accidentally re-use a variable that causes issues. Vogel100 wrote: Also why not make the thing into a function that you call twice? Because it's basically the same thing done twice with only a few changes. That would prevent a lot of repetition as well. This would allow users to mess around with a function, and I don't think it would be very necessary. Functions can be a pain to work with when it's imported with the script that also runs it.