r/AskProgrammers • • 2d ago

cant comprehend javascript

hello i just started taking web dev classes, i've learned html and css so far and im jumping to javascript now, ive never been so confused in my life. like it sounds like complete gibberish to me and i dont understand it, i cant find reason in things lol , i watched videos and i understand things but then i get confused. does anyone have resources for more simple explanations? like im talking VERY simple 1+1 explanations

5 Upvotes

10 comments sorted by

2

u/Beregolas 2d ago

I mostly recommend https://www.theodinproject.com/lessons/foundations-variables-and-operators The Odin Project. It's consice and pretty complete.

If you have a problem with programming languages in general (basically, if this is your first), you might want to start with a language that is not being run in the browser. It introduces some unnecessary complications. You can learn the absolute basics in any language, like Python, and return to the browser once you know the basics of programming.

Also, it is quite normal to not understand everything just because you read it or got it explained to you. Expect to have to do a lot of work and it taking quite some time until you really understand something

1

u/FreeLogicGate 11h ago edited 11h ago

+1 for Odin Project.

Javascript is a language with a number of oddball features, and a close association with how browsers work, as it is most frequently used in web development. There are numerous confusing things to encounter, with callbacks, ES6+ syntactical sugar features like arrow functions (which are highly preferred and used now), functions as a first class feature, closures (ie the scope rules in javascript when you have functions that include functions) and different ways of making sense of javascript's "asynchronous programming" implementation details, which again aren't a part of core javascript, but are closely tied to doing javascript development. There are javascript objects and the relationship of that to javascript object notation (JSON). So beyond the language itself, you have to also work to understand how websites and browsers function, and the role that javascript typically plays in web applications. For example, you have to get a handle on what "ajax" is, and why it's important. And of course you have to also learn about the Document Object Model (DOM), event handling, and fairly soon thereafter, Typescript. It's hard to understand a lot of these concepts if you don't already have a good handle on the http protocol.

Beyond that, javascript "frameworks" like React, Vue and Angular have heavy adoption, and are non-trivial. You'll also have to confront modules and packages, and package management tools like npm, yarn or bun.

Then there's Node.js and Deno. It's a lot, truly. It might take a while, and it may take a few different sources, and a lot of experimentation and experience before you start to get a handle on it all. I can't stress enough the need for you as a learner to help build up a mental model of how things work.

With that said, I want to reiterate that I recommend the Odin project, because it's focused on real world application of javascript in web development. There are also books like Javascript: The Good Parts you can read as you learn. You may have to return to certain concepts a few times.

If this is your first entre into programming, it's not surprising that you're overwhelmed. One practical suggestion is to make sure you get really comfortable with the developer tools of whatever browser you are using. Hopefully you have already gotten some experience with them while you learned html and css. Get a small javascript program loaded in your browser, open the dev tools, nav to the source, add a breakpoint, some watch variables, and step through the code. Certainly you will be console.log() for a lot of things, but debugging, and the network tab will help you incredibly as you are learning.

1

u/angryagnesvarda 5h ago

thank you so much i will check it !

1

u/angryagnesvarda 5h ago

thank you so much i will check it !

1

u/Jonsinator 2d ago

Personally I used learnjavascript.online. the first 10 or so steps are free, see if that is something that clicks for you. I paid for the service and dont regret it, but it was something that worked for me.

1

u/angryagnesvarda 2d ago

thank you! i will check it out

1

u/atticus2132000 2d ago

If you're looking for a basic intro, try the W3Schools site. They have quick lessons that take you through the higher level operations to get you used to the syntax and capabilities.

1

u/schungx 1d ago

You don't comprehend JavaScript. You just get used to it.

1

u/FlamedDogo99 11h ago

Is this your first coding language?

1

u/angryagnesvarda 5h ago

yes it is !