So I created this clock which displays Date and Time.
Is there a more elegant way to write this code, because for some reason it looks pretty messy, even though it does what i want it to do.
Thanks
Here is the code:
http://jsfiddle.net/vkramer/X4PMg/
Yes. Let’s ignore the nearly-minifed CSS for the moment. JavaScript has array literals. You should use those. So this:
Becomes this:
Then, never pass a string to
setTimeout. Don’t make variables and not use them.Other stuff, too, but this makes it acceptable. Also, stop pretending to use HTML5. A
<section>is completely wrong there, you should just use a<div>.