I believe in the sovereign right of all newbie programmers to write truly abysmal code. No one publishes poetry their first time around. JavaScript and HTML provide a great introduction to programming concepts and mindset, while limiting the harm you can do.
So what if all it does is spawn sparkly unicorn GIFs in random places on your webpage? It's still programming.

My first projects when branching out into new languages are usually designed to reinvent the wheel. While this is usually considered A Bad Thing in programming, re-writing some trivial utility or library from scratch is a good way to get your feet wet while having clearly-defined input and output specifications. For example, my first Perl script was "dir". I then modified it to write HTML lists. I could've then used this to replace Apache's directory lister, if I wanted, but I moved on to something else.
Once you have some familiarity with a language, it's a great idea to discover the libraries of pre-written code already available. But I learned LDAP by making my own "ldapsearch". It's less feature-packed than the real OpenLDAP version, but it's actually more convenient for me because it defaults to a paradigm that is aligned with what I usually need to do with Active Directory.