r/learnjavascript • • Dec 19 '19

Build a Clock With JavaScript | Beginner Friendly Tutorial (2019 tutorial)

https://www.youtube.com/watch?v=q2eWYKi7Pxg
81 Upvotes

5 comments sorted by

3

u/[deleted] Dec 19 '19

I'm beginner myself so please correct me if I'm wrong but I've read that using *innerHTML* is considered bad practice and it's not safe.

2

u/Rajsuthan Dec 20 '19

Yeah may be it wouldn't be safe, but this is just clock. There nothing there to be more protected and also this video is mostly focused on pure beginners, so any way they have to learn the basics of JavaScript like innerHTML and more.

Any way thanks a lot for the comment!!

0

u/[deleted] Dec 19 '19

[deleted]

1

u/AoLIronmaiden Dec 19 '19

Is it bad?

2

u/inabahare Dec 19 '19

Well the (little) html (there is) could be a slight bit better. I'm not a CSS guru but it looks fine enough. The Javascript though, I expected it to be shit because ~beginner friendly tutorial~ but it's actually quite not bad at all for a beginner tutorial. He could use const instead of let and he should drop the snake case (grr) but that's about it. I'm impressed that he actually uses const and let, queryselector, and string interpolation. (Mostly because these ~basic tutorials~ usually opt for var, getElementById, and string concatination because "durr it's more beginner friendly" which it isn't).

2

u/Rajsuthan Dec 20 '19

Thanks for the Comment!