1) Is there anything wrong with doing this:
'd' = document.getElementById;and then just using d('someID') throughout the rest of the page as I need it? I suppose I could write a function which returns the value, but why write a function if the above is completely fine is what I am thinking. Your input is greatly appreciated.
2) can anyone think of a more efficient way to write this:
return someString.replace(/a/g, "f").replace(/b/g, "g").replace(/c/g, "h").replace(/d/g, "i").replace(/e/g, "j");
I tried really hard to think of how I could use a function for the replacement letter, but the only functions I could come up with were not efficient enough to make up for replacing the 4 extra ".replace" and "//g,".
Thanks a bunch.