I’ve just started learning JavaScript, and I am focusing on the very basics. Understanding simple concepts like data types, how values are stored, and how operators work is really important.
Here’s a summary of what I learned:
1. Basic Data Types in JavaScript
Before writing complex logic, I needed to understand how JavaScript handles different kinds of data.
Primitive Data Types
These are simple DataTypes:
• String - Text → Name of a person, word
• Number - Whole number
• Boolean - True/False → answering a yes/no question: true or false
• Null - Empty → A variable that has no value
• Undefined - Not assigned → A value has not been assigned yet or exist
• Symbol - represents a unique, immutable value.
• BigInt - handling and storing big integer values.
2. How Values Are Stored
One of the first things I learned in JavaScript is that not all values are stored the same way.
Simple Values (Primitive)
Numbers, text, and true/false values are stored directly in memory. This means when you copy them, you get a completely new value. Changing one does not affect the other.
Objects (Reference)
Objects work differently. JavaScript stores a reference to the object, not the object itself. That means if you copy an object and then change it, the original also changes because both variables point to the same object in memory.
I learned that data types are different kinds of information, like text, numbers, and true or false values. Text is called a string, numbers are used for counting or math, and true or false values are called booleans. I also learned that objects are stored differently. When you copy an object, you are not making a new one. You are just pointing to the same object in memory. So if you change it, both variables change. My next Next plan to study is learn how to create Loops and how to use Conditional Statements.
Top comments (0)