Basic JavaScript Syntax Is Not Sticking!?!
Question: How does one memorize JavaScript or coding in general? I know repetition. I code every single day and every single day it feels like I am doing it from scratch. This syntax does not stick with me sadly. Probably not the smartest person for programming. I love it though and I want to feel comfortable before applying for a job again. Any advice besides code every day? Was thinking of doing flash cards. Your input is appreciated.
Get AlfonsoTech’s stories in your inbox
Join Medium for free to get updates from this writer.
Answer: Do you mean the basic syntax? I hear this from a lot of new learners, that it’s just not sticking in their brains, so you are definitely not alone! Here is what I advise my students: If you write out a for-loop between 10 and 100 times, at some point in there you will remember the syntax. However, you should write it out by hand, as hand-eye coordination enhances retention. Focus on just the syntax or structure until you are comfortable replicating it. Avoid cutting and pasting code. There are only five types of structures you need to memorize for the basic syntax:
- How to declare variables,
- Conditional statements (if-else, else-if, switch statements, etc.),
- Functions (declarations, expressions, anonymous, arrow functions),
- Iteration tools (for-loops, for-in, for-of, and possibly the .forEach() method),
- Data structures (arrays, objects, complex structures like arrays inside of objects).
For example, write the empty if-else-if-else structure like this:
if () {
} else if () {
} else {
}It’s important to know these thoroughly because it frees up the mind to think about the logic of what you’re coding. Keep in mind, some shapes may never stick properly, and you’ll find yourself looking them up often. However, knowing what you use repeatedly helps you become more fluent.
A note on flashcards: they can also be effective and reinforce your knowledge, especially if you use them while walking. Combining movement with flashcards is a winning strategy, but you’ll probably still need to do some rote memorization first.









