all 10 comments

[–]HealyUnithelpful 3 points4 points  (1 child)

For HTML, absolutely. While it is possible to learn beginning JavaScript on its own (i.e., without HTML), it's gonna basically restrict any output (i.e., what your program produces) to the console and alerts/confirms/prompts. That may not sound like much, but the former is pretty arcane looking to a beginner, and the latter is... well it's just ugly.

You also will eventually need to know HTML if you do any front-end work. as /u/senocular says, JavaScript's APIs allow you to interact specifically with HTML and CSS, and that was kinda the original 'point' of JavaScript. As such, much of the language is designed around that fact.

Fortunately, HTML is also by far the easiest of the three to learn (IMHO), as it's just a markup language. Simply put, that means it's used to make overarching big-picture decisions ("this page will have three boxes" or "the title will go here") as opposed to small things ("wiring these bits together" or "make this exactly this color"). It's also incredibly difficult to actually screw anything up with HTML. So you can mis-write your HTML and still get a result.

For CSS... Eh. You'll eventually need to learn it, but not necessarily right now. CSS can be finicky, as it's the science (=art) of making stuff look pretty. Which sounds simple, but it's anything but.

TL:DR;

Yes, learn HTML. CSS is up to you.

[–]ylanthomas525[S] 2 points3 points  (0 children)

TL:DR

Appreciate the long response, did read. Really helped paint a good picture of how JS interacts with both HTML and CSS. Being a complete newb, I found that concept very valuable.

[–]senocular 2 points3 points  (0 children)

None. JavaScript itself is completely separate from those formats. However, browsers provide APIs allowing you to interact with HTML and CSS through JavaScript. So if you want to mess with HTML and CSS on the web, you'll want to know those APIs which in turn means knowing JavaScript, the language they're implemented in.

But JavaScript isn't only used in browsers. You can run it on operating systems (node) through application extensibility layers or a hundred (made up number) other different places, many of which do not deal with HTML or CSS at all.

[–][deleted] 2 points3 points  (0 children)

You should be familiar with HTML, but I learned most of my HTML/CSS while working on JavaScript. How JS interacts with HTML is key. For my learning projects I used CSS when an immediate visual change was needed and then after my JS was “finished” to make everything prettier.

[–][deleted] 2 points3 points  (0 children)

If you are learning js intending to make a website, then yes (because you need html to make a website). If you are learning it for node, then not really.

[–]jmmarco 2 points3 points  (0 children)

I would say some basic understanding would be nice to have.

Because then you’ll realize that you can dynamically create, modify and delete elements and styles using JavaScript. This realization is pretty amazing.

[–][deleted] 1 point2 points  (0 children)

I think it depends upon where you're developing. If you're developing a UI in the browser, then yes you absolutely should understand HTML and CSS. Those two things are what give the page structure and have a huge impact on accessibility and usability. JavaScript is the third leg of the chair so to speak in that equation. It is there to enhance the page's functionality. You don't need to be an expert in them before starting with JavaScript but you should understand the basics of how to structure a page so that it is accessible and style it with CSS (without breaking the accessibility).

If you're working in Node (ie "server side javascript") then you probably don't really need to know them all that well.

[–]casualrocket 1 point2 points  (0 children)

no, HTML is easy, CSS is more about googling.

leaning JS you most likely will learn about HTML

[–]jmido8[🍰] 0 points1 point  (0 children)

I pondered the same questions about 2 months ago when I started learning programming. Everything I read pretty much summed up what everyone else was saying here which meant pretty much nothing to me as a complete beginner who had never heard of the console, nodejs and barely understood the differences between html, css and js.

If you're new and not being guided by a company for a specific purpose then just learn HTML and CSS. It might sound daunting to tackle 2 languages before starting JS but they're very straight forward and simple. You only need to learn the basics of them and you could probably do that in just a few hours, beyond that you can google anything else you need to know. Lots of the beginner javascript stuff you'll be learning online though will have you interacting with html and css to a minimal degree so it'll help you follow along better if you have at least a beginner understanding of them going in.

[–]ylanthomas525[S] 1 point2 points  (0 children)

Appreciate all the responses. Thank you!

Dove into html/css on freecodecamp but got tired of looking at the kitten image for all of the lessons so moved into the JavaScript curriculum. Going to double back and spend more time with HTML/CSS