DEV Community

Teye Quashie
Teye Quashie

Posted on

Beginning with JavaScript

Today was my first real step into the world of JavaScript, and honestly… it felt like opening a door to a whole new universe. I watched a 2hour tutorial, and even though it was long, I actually understood a lot of things. Here’s my simple breakdown of what I learned, in a way even a kid could understand

JavaScript: What I Found Out

One of the first things I learned is that JavaScript is a very powerful and widely used programming language. It helps websites come alive and become more fun and interactive.
If a website does something when you click or type: that’s JavaScript behind the scenes.

I also learned about IDEs (places where you write your code). The one we used was VS Code, which becomes even cooler when you add some extensions like:

Live Server – lets you see your website update instantly.

GitHub Theme – just makes VS Code look nicer.

JavaScript Code Snippets – helps you write code faster.

Prettier – keeps your code neat and tidy.

And yes, I learned that JavaScript files always end with ".js".
So a file like script.js is a JavaScript file.

Linking JavaScript to HTML

I also learned that JavaScript doesn’t always live inside the HTML file.
You can keep it in a separate .js file and link it like:

But if you don’t want a separate file, you can just write your JavaScript inside the HTML between:

 "<script>
  // your code here
 </script>"
Enter fullscreen mode Exit fullscreen mode

Simple and clean.

      **Variables**
Enter fullscreen mode Exit fullscreen mode

We started with variables, which I like to think of as little boxes where you store information.
You can keep numbers, text, or anything you want inside these boxes.

Example:

Let age = 20;

Here, age is the box, and 20 is what we put inside.

    **Datatypes**
Enter fullscreen mode Exit fullscreen mode

Then we moved into datatypes, which basically tell JavaScript what kind of thing is inside the variable.

Some types we learned:

*Number

*Boolean (true/false)

*String (text)

We also played with relational and equality operators — things like <, >, ==, ===, etc.

     **Strings**
Enter fullscreen mode Exit fullscreen mode

Strings were actually fun because they’re just text, and we did a bunch of things with them:

Concatenation — joining strings together.

Append — adding more text at the end.

Changing cases — like making everything UPPERCASE or lowercase.

Slice — cutting out a part of a string.

Split and Join — breaking a string apart and putting it back together again.

   **Type Conversion**
Enter fullscreen mode Exit fullscreen mode

This part showed me how to change one datatype to another.
Like turning a number into a string or a string into a number.
It’s like telling JavaScript, “Hey, treat this thing differently now.”

    **Control Flow**
Enter fullscreen mode Exit fullscreen mode

Next up was control flow, which basically means “deciding what the program should do next.”

We learned:

*If & Else

This lets the program make decisions.

If (age > 18) {
Console.log(“You’re an adult”);
} else {
Console.log(“You’re not an adult yet”);
}

*Switch

Another way to handle different options.

        **Loops**
Enter fullscreen mode Exit fullscreen mode

Loops were actually cool because they tell the computer to repeat something without us writing it many times.

We learned:

For loop

While loop

Do…while loop

A simple loop example:

For (let i = 1; i <= 5; i++) {
Console.log(i);
}

This prints 1 to 5 without me typing five separate console.log lines.

    **Final Thoughts**
Enter fullscreen mode Exit fullscreen mode

Overall, today’s session taught me that JavaScript is not as scary as it looks.
It’s actually fun,like teaching a computer how to think step-by-step.

I’m still a beginner, but I’m proud of what I learned.
Can’t wait to see what’s next on this journey.

Top comments (0)