James McGrath

Quick tips, in-depth guides, and thoughts on the future of the web

What Is an Object?

🧪 Concept:

An object is like a mini file folder. You can pack it with labelled facts about something — a person, a place, a donut 🍩

In JavaScript:

let person = {
name: "Riley",
age: 30,
loves: "hiking"
};

Now you’ve created an object with properties — bits of information tied to keys like name, age, and loves.

Want to access one?

console.log(person.name); // Riley

🧰 Why It Matters:

Objects let you group related info together. They’re super useful when you want to keep things organized and readable — especially when your code gets more complex.

🎉 Quick Challenge:

Make your own object about… you!

let me = {
name: "Jamie",
favoriteColor: "green",
isCool: true
};

console.log(me.favoriteColor);

🧠 Fun Analogy:

Think of an object like a backpack with labelled pockets. One has your name, one has your age, one has a granola bar. Reach into the pocket to grab the info.

📚 Further Reading:

MDN Docs – Loops and Iteration
W3Schools – JavaScript Loops

Join us tomorrow for Day 5!

Subscribe to my feed to follow along. I’ll keep the lessons short and sweet.

What is an Array?

One response to “What Is an Object?”

  1. […] What Is an Object? […]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.