Layman's explanation:

An object is a collection of properties. You can give a name to the object to keep things organized. For example, lets create a person object.

var person = {};

The object has no properties right now. To further describe the person we can add properties to the object.

person.Name = 'Zim';
person.Age = 29;
person.Gender = 'Male';
person.Weight = 80;

Now this object has some properties to help describe it. A different way to write the same thing:

var person = { Name: 'Zim', Age: 29, Gender: 'Male', Weight: 80 };

If we had to create a program that displays a list of people, storing all of our information inside objects would help keep things organized.

Object properties are sometimes referred to as keys.


Adding properties to objects:

You can add a property to an object using brackets, just like you had in your addProperty function. If you just need it to add a property, set that property to null and return the result it would look something like this:

function addProperty(object, property) {
  // code here
  object[property] = null;
  return object;
}

This would let us create a properies on our object from above by calling

addProperty(person, 'Occupation');
addProperty(person, 'Income');
addProperty(person, 'Height');
Answer from IrkenInvader on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Object
Object - JavaScript - MDN Web Docs
Nearly all objects in JavaScript are instances of Object; a typical object inherits properties (including methods) from Object.prototype, although these properties may be shadowed (a.k.a. overridden).
🌐
Mozilla
developer.mozilla.org › en-US › docs › Web › JavaScript › Guide › Working_with_objects
Working with objects - JavaScript - MDN Web Docs - Mozilla
February 21, 2026 - JavaScript is designed on an object-based paradigm. An object is a collection of properties, and a property is an association between a name (or key) and a value. A property's value can be a function, in which case the property is known as a method.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-object-properties
JavaScript Object Properties - GeeksforGeeks
JavaScript objects store data as key–value pairs, making them ideal for representing real-world entities. Object properties allow developers to easily organize, access, and modify related data.
Published   January 16, 2026
🌐
W3Schools
w3schools.com › js › js_object_properties.asp
JavaScript Object Properties
JS Examples JS HTML DOM JS HTML Input JS HTML Objects JS HTML Events JS Browser JS Editor JS Exercises JS Quiz JS Website JS Syllabus JS Study Plan JS Interview Prep JS Bootcamp JS Certificate JS Reference ... Properties can be changed, added, and deleted.
Top answer
1 of 4
2

Layman's explanation:

An object is a collection of properties. You can give a name to the object to keep things organized. For example, lets create a person object.

var person = {};

The object has no properties right now. To further describe the person we can add properties to the object.

person.Name = 'Zim';
person.Age = 29;
person.Gender = 'Male';
person.Weight = 80;

Now this object has some properties to help describe it. A different way to write the same thing:

var person = { Name: 'Zim', Age: 29, Gender: 'Male', Weight: 80 };

If we had to create a program that displays a list of people, storing all of our information inside objects would help keep things organized.

Object properties are sometimes referred to as keys.


Adding properties to objects:

You can add a property to an object using brackets, just like you had in your addProperty function. If you just need it to add a property, set that property to null and return the result it would look something like this:

function addProperty(object, property) {
  // code here
  object[property] = null;
  return object;
}

This would let us create a properies on our object from above by calling

addProperty(person, 'Occupation');
addProperty(person, 'Income');
addProperty(person, 'Height');
2 of 4
2

I think you're over-thinking it.

First the question:

Add the value of the property argument as a key on the object argument. The value of the new property should be set to null. Return object after adding the new property.

emphasis added

So, property will be the KEY (of a key/value pair), and the VALUE will be null of object, which we are also passing in as an argument.

One way to interrogate key/value pairs on a javascript object is through the square-brackets []. So, if you have a key/value pair: { foo: "bar" }, you can get "bar" by: object['foo']. You can also create new key/value pairs like this, so your function can look like:

function addProperty(object, property) {
    object[property] = null;
    return object;
}

var obj = {};

obj = addProperty(obj, "hello");

console.log(obj);
console.log(addProperty({x: 5}, 'y'));

What our function is doing is taking the object passed into it (as an argument), creating a new KEY with our property argument, and setting its VALUE to null, and simply returning the object.

*Side note -

Be careful, the code you have posted will create an endless recursive loop, as you keep calling the same function with no way to break out of it.

🌐
TutorialsPoint
tutorialspoint.com › javascript › javascript_object_properties.htm
JavaScript - Object Properties
An object property in JavaScript is a key: value pair, where key is a string and value can be anything. The key in key: value pair is also called property name. So the properties are association between key (or name) and value.
🌐
JavaScript Tutorial
javascripttutorial.net › home › javascript tutorial › javascript object properties
JavaScript Object Property Types and Their Attributes
December 17, 2023 - You will learn about the JavaScript object's properties and their attributes such as configurable, enumerable, writable, get, set, and value.
Find elsewhere
🌐
Codecademy
codecademy.com › learn › game-dev-learn-javascript-objects › modules › game-dev-learn-javascript-objects › cheatsheet
Learn JavaScript: Objects: Learn JavaScript: Objects Cheatsheet | Codecademy
Nested properties of an object can be accessed by chaining key names in the correct order. ... An object is a built-in data type for storing key-value pairs. Data inside objects are unordered, and the values can be of any type. When trying to access a JavaScript object property that has not been defined yet, the value of undefined will be returned by default.
🌐
Simplilearn
simplilearn.com › home › resources › software development › javascript tutorial: learn javascript from scratch › javascript objects: properties, methods, and accessors
JavaScript Objects: Properties, Methods, and Accessors
January 30, 2025 - Learn what is javascript object, how to create a javascript object, and understanding javascript object properties, methods, and accessors. Read to learn more
Address   5851 Legacy Circle, 6th Floor, Plano, TX 75024 United States
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Glossary › Property › JavaScript
Property (JavaScript) - Glossary - MDN Web Docs
July 11, 2025 - A JavaScript property is a member of an object that associates a key with a value. A JavaScript object is a data structure that stores a collection of properties.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Operators › Property_accessors
Property accessors - JavaScript - MDN Web Docs - Mozilla
There are two ways to access properties: dot notation and bracket notation. In the object.propertyName syntax, the propertyName must be a valid JavaScript identifier which can also be a reserved word.
🌐
JavaScript.info
javascript.info › tutorial › the javascript language › objects: the basics
Objects
February 17, 2026 - In JavaScript, objects penetrate almost every aspect of the language. So we must understand them first before going in-depth anywhere else. An object can be created with curly braces {…} with an optional list of properties.
🌐
W3Schools
w3schools.com › js › js_objects.asp
JavaScript Objects
Getters and setters allow you to define Object Accessors (Computed Properties). ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales@w3schools.com · If you want to report an error, or if you want to make a suggestion, send us an e-mail: help@w3schools.com · HTML Tutorial CSS Tutorial JavaScript ...
🌐
CodeSweetly
codesweetly.com › javascript-properties-object
Object in JavaScript – What Is a JavaScript Properties Object? | CodeSweetly
An object is an element you can use to bundle up multiple named values into a single item. A pair of braces define JavaScript's properties object.
🌐
2ality
2ality.com › 2012 › 10 › javascript-properties.html
Object properties in JavaScript
October 29, 2012 - JavaScript has three different kinds of properties: named data properties, named accessor properties and internal properties. “Normal” properties of objects map string names to values.
🌐
Dmitri Pavlutin
dmitripavlutin.com › access-object-properties-javascript
3 Ways To Access Object Properties in JavaScript
January 25, 2023 - You can access an object property in JavaScript in 3 ways: dot property accessor, square brackets property accessor, or object destructuring.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Learn_web_development › Core › Scripting › Object_basics
JavaScript object basics - Learn web development | MDN
The value of an object member can be pretty much anything — in our person object we've got a number, an array, and two functions. The first two items are data items, and are referred to as the object's properties.
🌐
Medium
medium.com › @ericvanrees › accessing-object-properties-and-values-in-javascript-bd2b13d8b61f
Accessing Object Properties and Values in JavaScript | by Eric van Rees | Medium
August 5, 2023 - Or, we can access object properties and values using a for loop: There are many more ways to loop over an object’s key and values. More info here. Let’s look at a single “complex” object, found inside an array. The myMusic object contains an array (the “formats” values), which is not uncommon in JavaScript.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Object › values
Object.values() - JavaScript - MDN Web Docs
Object.values() returns an array whose elements are values of enumerable string-keyed properties found directly upon object. This is the same as iterating with a for...in loop, except that a for...in loop enumerates properties in the prototype chain as well.