Articles

Understanding for loops

Let’s say you want to run a function, bounceBall, four times. How would you do it? Like this?

function bounceBall() {
// bounce the ball here
}

bounceBall() bounceBall() bounceBall() bounceBall()

This approach is great if you need to bounceBall only for a few times. What happens if you need to bounceBall for a hundred times?

The better way is through a for loop.

Understanding if/else statements

Let’s say you’re walking on a busy street in the middle of town. You’re about to cross the road when you notice the traffic light for pedestrians turns red. What do you do?

You stop, don’t you?

And what happens when the light turns green again? You start walking.

We can put this analogy into code too. It sounds something like: “If the light turns red, stop walking. Otherwise, continue walking”.

And that, my friend, is the foundation of an if/else statement.

How to debug Javascript errors

It’s normal for you to make errors when you code. So if you see an error, you don’t have to be afraid. I get error messages all the time. When I have bad days, I get more error messages!

Learning JavaScript – where should you start and what to do when you’re stuck?

Have you tried to learn a JavaScript related topic/framework and found that you understand almost nothing?

There is a simple reason why you don’t understand what you’re learning – you skipped steps. You tried to learn something advanced without having the fundamentals to back yourself up.

What you’re trying to do by learning things that are far too advanced is like trying to drive an F1 without a drivers’ license. Can you imagine how badly you’ll crash?

Console.log everything!

When you write Javascript, you’re bound to be unsure of something in your code somewhere. That’s a normal thing.

When you’re unsure, you need to clarify what that unknown thing is. Otherwise, you won’t be able to code anything up.

And how do you clarify?

You write console.log statements.

Understanding JavaScript Functions

Imagine you live in an village without tap water. To get water, you need to take a empty bucket, head to the well in the middle of the village, draw water from the well and head back home.

You need to draw water from this well multiple times a day. It’s a hassle to say “I’m going to take an empty bucket, go to the well, draw water and bring back home” every time you explain what you’re doing.

To shorten it, you can say you’re going to “draw water”.

And my friend, you’ve created a function.

Should you use semicolons in JavaScript?

I promised I’d start making videos last week, didn’t I? Well, here’s the first video! Today, I’d like to talk about semicolons.

There are people out there that say you’re not a real developer if you don’t use semi-colons in JavaScript. Is that really true? Should you listen to them and use semi-colons?

That’s what I dive into in this video. I also show a very important tool to help you write good, consistent code in the video.

Announcing Learn JavaScript!

Are you struggling with JavaScript?

When you face that blank JavaScript file, does your mind goes blank?

Do you wish to stop copy/pasting code or modifying what you find online, and write code from scratch instead?

Do you feel that your code is messy and you want to improve?

If you’re facing any of these challenges with JavaScript, I’ve got good news for you. I’m writing a course called Learn JavaScript, which will guide you, step by step, to build real components from scratch.

How to overcome your fear of JavaScript

JavaScript can be scary. It can be scarier for you if you’ve never been to programming school before, and it is even scarier if you tried to learn it through different books and courses, but you found that you’ve failed along the way.

“I don’t get it. I’m smart, but why can’t I learn JavaScript?”

“Can you really learn JavaScript without going to school?”

So these questions pop into your head. It gets even scarier. When you look at JavaScript you don’t even dare to begin learning it. You look at your computer and you put it down, thinking you’ll do it another day.

Don’t worry if that applies to you.

You’re not the only person who has the same problem. I did before too. When I tried to learn JavaScript, I failed. There was a period of time where I was really afraid of JavaScript.

But that doesn’t mean you’ll never succeed at learning JavaScript. You can know JavaScript and you can write JavaScript even though you don’t have a programming background.

So the first step to learning JavaScript is to overcome that dreadful feeling you feel when learning JavaScript. That’s what you’ll learn in today’s article.

Hold on while i sign you up…

🤗
Woohoo! You’re in!
Now, hold on while I redirect you.