Ask HN: What is the best way to learn JavaScript for a beginner?

17 points by joshcox ↗ HN
So I just completed HTML & CSS and now I want to learn Javascript, what are some of the good online resources that only focus on Javascript stack? Books or screencasts are okay for me.

15 comments

[ 2.8 ms ] story [ 37.2 ms ] thread
Don't go after "learn javascript". Try to "learn to program" first. The only way to learn anything is BY DOING. You have to sit and code. Are you going to play great basketball just watching the NBA? NO! You have to go outside and play. In the world of coding that translates to: sit and code.

Online resources, there are many. Too many sometimes. Grab anything from codecadeamy, codeschool, or Tree House. But remember that's not the only thing you need to know.

If you check my profile, we do remote programming courses where people work together with a real teacher for 6 weeks. We offer scholarships (100% free).

Remember: * Focus on learning programming. What's the scope of a variable? what's immutability? etc. * Practice a lot. Code as much as you can. * Look up for a group to work together.

Eloquent Javascript. It's one of the best introductions to programming I've ever read. http://eloquentjavascript.net/
yes, I second this. Reading this book has always clarified core javascript to me. I go back to it all the time for reference.
Practice as much as you can. Write lots of code. Try to solve problems. Don't be afraid to reach out to people and ask questions. The best way to learn Javascript and programming is by doing it. JUST DO IT! As for books I'd recommend "Head First JavaScript". They're great for beginners. If you're comfortable with screencast try Learn Javascript in 14 days course on iLoveCoding and then move on to the lessons https://ilovecoding.org/lessons.

If you get stuck, ask questions on Stack Overflow or Reddit. Good luck

In the past, I bought some team members access to codeschool.com. The price is really fair and they have screencasts, course syllabus and tasks that help you learn whatever you are taking from them. I was pretty impressed, it worked well for Javascript and HTML/css and I'd have no problem subscribing again if there was a need. IIRC, it was a monthly price but was fairly inexpensive and we only had it like 6 months and then cancelled because they had gone through the courses they wanted.
I'd recommend a 3 pronged approach:

1. Read specific Javascript stuff (I'd also recommend Eloquent Javascript as others have). Code school free courses can help with the basics too.

2. Try and find someone who you can speak to from time to time about Javascript stuff. They can introduce you more advanced stuff (like Grunt/Gulp), which even if you can't understand it all, helps expand your horizons and show you what to look at when you're comfortable with the simple stuff.

3. Read about programming in general, because the principles apply to any programming language. I'd recommend Code Complete by Steve McConnell. It's a bit daunting but full of great stuff to make you think about your approach to programming.

good luck!

If you programmed in other languages before, I would recommend "JavaScript the Good Parts" and "Pro JavaScript Techniques". Both were about the language itself and how to avoid a few ugly edge cases.

Disclaimer: I already knew C, Java, PHP and VisualBasic before I started with JavaScript .

There is a lot of good advice elsewhere. I'd recommend Norvig's essay:

http://norvig.com/21-days.html

The complexity of programming ramps up really fast from "Hello World" toward professional tools and techniques due to a massive permutation space and in the case of JavaScript comprehensive instability in best practice.

Good luck

"just do it"

JavaScript (or any programming language for that matter) cannot be learned by just reading. One must actually write with the language to get used to the language, as well as gain muscle memory for the syntax. Do something, even something very simple, like a console-based game (which is essentially just a state machine), or create your own pub-sub library (which deals alot with object and array manipulation), or recreate some data structure (binary tree, linked lists, rings, etc.). These simple exercises can go a long way.

These books help as well.

- JavaScript: The Definitive Guide

- High Performance JavaScript

I recommend https://ilovecoding.org/ There are lots of awesome answers there, do read books and watch Javascript tutorials but don't just read or watch them. GO AND WRITE CODE. Don't procrastinate, just do it. You learn by doing it.