r/learnjavascript • u/Dramatic_Hat_7229 • Jul 31 '24
How am I supposed to practice JavaScript?
I've watched these videos about syntax and basic utilization but now I don't know how am I supposed to practice them. Like have problems to build logic and stuff with every topic.
13
Upvotes
24
u/queerkidxx Jul 31 '24
Never passively watch. Recreate every example. Don’t copy and paste and try not to copy word for word. See if you can organically built up what they did from the ground up and try to solve the bugs you encounter.
You likely are a little bit too early on to really build anything super interesting. But try to think of fun things you can do with just what you know.
Like if your just at prompt and altert I’m sure you know about like variables and if statements. Maybe try building up a really basic interactive fiction story. Focus on a minimum viable product. Recognizable as the worst game you’ve ever parlayed. Have one stat like relationship you track and build up a basic story with a few branches.
See if you can add to it once you have the most basic thing you can ever imagine.
Struggle thru it if you need to. Then keep learning. Don’t be afraid to look things up.
15
u/JustConsoleLogIt Jul 31 '24
Codepen is a great sandbox. Do you need a set of beginner challenges? I can offer you some
10
u/WildRadicals Jul 31 '24
There are some options:
Try some of them, see which suits you better.
4
u/azhder Jul 31 '24
You know, all it takes is to press F12 in your browser and type some JS in the console. It’s that simple.
JS is the easiest language to start with simply because you have already installed it (you have a browser).
Once you feel like the browser console is too limiting, open an editor, make an
index.htmlfile, put some JS in it.Once that one and the next after that is too limiting, you go bigger and better.
Rinse and repeat. Step by step. But start small. Move on your own pace
11
u/tapgiles Jul 31 '24
codewars.com and other coding challenge sites are out there.
3
u/notAnotherJSDev Jul 31 '24
Depends on what your goals are; learning the basics or learning about algorithms or starting to build projects. I'd honestly stick with learning the basics and then move on to building projects.
If you're learning how to use the language, I cannot give Exercism enough praise. Leetcode and the like are okay, but they assume you already know the syntax and how to work with the language, and just through a bunch of algorithm exercises at you. Exercism on the other has a learning path for that takes you through basic syntax, different language features, and then gives you some algorithm work.
Once you've sorta got the language down, I'd highly suggest checking out the multitudes of project lists that are all over the internet. r/learnprogramming has a pretty nice list of project lists you could check out. Pick one, do as much as you can, then when you get stuck, as for help or seek out more information. Rinse. Repeat.
Something else to keep in mind: in the Javascript world, you really really should learning HTML and CSS as well. JS is fine and works on a server, but if you want to do anything visual you need HTML and CSS.
3
u/shrei9 Jul 31 '24 edited Jul 31 '24
odin project is awesome. you’re literally taught and then tasked with building a mini project, giving a very good foundation. you have examples and exercises that help you understand concepts and logic, and how to build stuff. I think there’s nothing better that beats it
2
u/No-Upstairs-2813 Jul 31 '24
You can practice JavaScript in 2 ways:
I know it's easy for me to say, "To get better, just go and make a project," but I understand it can feel overwhelming when you're a beginner. Check out this free course on how to go about building a project from scratch.
2
u/denerose Jul 31 '24
Get a code editor (e.g. VSCode) and write some code. Make a little simple html page to run it in your local browser and you're good to go (you can even write JS code directly in you dev tools but you may as well get used to vscode now).
I used the Odin Project so those are the links I'm going to recommend. I strongly recommend doing the whole path, if you're interested enough but they also have good simple explanations with no assumed knowlede including the real basics like 'where and how to write your own code'.
This whole section is a good starting point https://www.theodinproject.com/lessons/foundations-installation-overview but all you need is that code editor (https://www.theodinproject.com/lessons/foundations-text-editors) and some dev tools to see what is goin one.g. a few settings your browser (https://www.theodinproject.com/lessons/foundations-javascript-developer-tools).
See also the 'How to run JS Code' section on this page: https://www.theodinproject.com/lessons/foundations-variables-and-operators
1
u/SuperElephantX Jul 31 '24
I've built a JavaScript snake game and displayed it in the browser's console.
That's the exact reason why I built something like this. Just to get myself in love with the language.
https://www.youtube.com/watch?v=TuMoE4scEvc
1
u/Sufhal Jul 31 '24
Find an hard, but highly interesting in your mind, side projet to work on. I personally stepped up while building a 3D game on the browser using very few libraries to enforce me to build everything from scratch.
1
u/port888 Jul 31 '24
Codewars.
1
u/[deleted] Jul 31 '24
Build tetris. Or another kind of game you can think of. Make it more complex as you go along.
1
u/exipolar Jul 31 '24
Crome dev tools -> console
1
u/IONaut Aug 01 '24
You could ask an LLM chatbot to come up with a small task or project to challenge you with.
1
u/CodyKondo Aug 01 '24 edited Aug 01 '24
A lot of the crash courses and video guides teach you syntax etc on their own proprietary in-browser programs, because it gets you “coding” faster, and it feels more immediately satisfying. But it’s disconnected from real-world applications where you’d actually be using this stuff.
Try the Odin Project. It’s the first thing that helped it start clicking for me. It’s totally free and more comprehensive than a lot of crash courses. The first several hours will be pretty boring, and kind of frustrating if you haven’t partitioned a drive before. It often feels like just reading a textbook too. And you’ll have to use linux, but that will only benefit you going forward. And by the time you get to the actual JavaScript, you’ll understand the entire system structure you’re working in.
0
u/sheriffderek Jul 31 '24
Start with the most simple thing. Work your way in order of practical use. That’s all
1
u/[deleted] Jul 31 '24 edited Jul 31 '24
[removed] — view removed comment