PRO 30% Free • Stripe ($15) & Razorpay (₹899)

Represent Everyday Things with Objects

Top Course Staff · 1 min read · Web development · PRO · 30% Free Preview Available

Represent Everyday Things with Objects

What is an Object?

When we take a look at an item, we can come up with a few key characteristics that describe it. Take for instance, a dog. When we think of a dog, we might describe it using characteristics like its name, its body size, fur color, etc… While each individual characteristic doesn’t represent a dog, collectively we get a sense of what a dog is.

Now, let’s think about how we could represent a dog in code. We could write all the dog’s information in a string, but it would be hard to extract information afterward. We could even store all the information in an array, but then we would have to rely on the ordering to keep track of each characteristic. What if we wrote out the information like so:

let theBestDogEver = {  name: 'Air Bud',  bodySize: 'large',  furColor: 'golden'};
Copy to clipboard
let theBestDogEver = {  name: 'Air Bud',  bodySize: 'large',  furColor: 'golden'};

Then our “characteristics” are stored as a collection of key-value pairs, like the key ofnameis tied with the value'Air Bud'. What we have in the example above is aJavaScriptobject! Generally, these “characteristics” that are tracked with key-value pairs are known asproperties. These properties don’t follow any set order, rather these properties all exist inside the dog object and we can easily retrieve and manipulate the values by the key.

As you start learning more about objects, you’ll see how you’ve actually interacted with objects before and expand the possibilities of your programs!

'The Codecademy Team, composed of experienced educators and tech experts, is dedicated to making tech skills accessible to all. We empower learners worldwide with expert-reviewed content that develops and enhances the technical skills needed to advance and succeed in their careers.'

30% Free Preview Reached · Unlock Remaining 70%

Complete Payment to Unlock Full Guide & Source Code

You are viewing the 30% preview. Join TopCourseAI Pro to unlock the remaining 70% of this article, unblur all code snippets, and gain full access to all 412 technical projects and guides.

✓ Full Access to All 160+ Projects
✓ Instant Blur Removal Everywhere
✓ Production Source Code & Blueprints
✓ All Future Deep Dives Included
Instant Unhindered Activation ·
End of Preview · Unlock Complete Blueprint & Source Code

Ready to access the complete step-by-step tutorial?

Gain full unhindered access to all 412 technical projects and guides, unblur all source code snippets, and download runnable scripts.

Production AI Blueprints

Ready to build production-grade AI systems?

Enjoyed this guide? Continue exploring our library of 166+ production blueprints, multi-agent swarms, and autonomous agent systems with 100% unblurred, executable source code.