DEV Community

Shawn2208
Shawn2208

Posted on

Javascript dumbed down guide part two

Alright, we’re back for Part Two! Remember, we're keeping things simple, so grab a cuppa and let’s dive right in. We’re exploring the different things (or "data types") we can play with in JavaScript.

  1. Numbers:
    What are they? Just your regular numbers: 7, 3.14.
    Fun Fact: Whether it’s a whole number or one with a dot, JavaScript treats them the same way!

  2. Strings:
    What are they? Words or sentences wrapped up in quotes. Example: "Hi there!" or 'I love JavaScript!'.
    Cool Trick: With a special kind of quote (``), you can include variables inside a string:

`
let petName = "Buddy";
console.log(`My pet's name is ${petName}.`);
`

  1. Boolean:
    What are they? Just a simple true or false.
    Think: Light switches – they’re either ON (true) or OFF (false).

  2. Arrays:
    Imagine: A tray of muffins. In JavaScript, it looks something like:

`
["chocolate", "blueberry", "banana-nut"]
`

.
Remember: Each muffin (or item) on that tray has a position, starting from 0.

  1. Objects: Imagine: A toy box with labels on each toy.

`
let myToyBox = {
favoriteToy: "Space Rocket",
color: "red",
isBroken: false
};
`

Remember: Each label tells you something about the toy.

  1. The Mysterious Ones: null and undefined.
    null: It's an empty spot, intentionally left blank.
    undefined: It's like an empty toy box; you don’t know what’s supposed to be inside.

  2. Symbols:
    Imagine: A secret handshake. It’s unique and only you and your friend know about it.
    Use: Mostly for special tricks, but not something you need to worry about right now!

A Quick Recap:
Numbers are...well, numbers.
Strings are words or sentences.
Booleans are simple true or false.
Arrays are like trays of muffins (or lists).
Objects are like labeled toy boxes.
null and undefined are our mysterious ones.
Symbols are like secret handshakes.
Thank you so much for joining me for Part Two! If you’re enjoying this, let me know, and don’t forget to come back for Part Three, where we’ll dive deeper. And always remember, coding is a journey – it’s all about having fun and learning bit by bit.

What's next?
Stay tuned for more! I've got plenty of stories, metaphors, and dumbed-down explanations up my sleeve. Coding is vast, and there's always more to learn and share.

To all the code newbies out there: Keep typing, keep breaking things, and most importantly, keep fixing them.

"Start with the basics, then expand."

Next up will be introduction concepts of control flow, basic functions, and interactions.

Until next time

Top comments (0)