Skip to content

Commit

Permalink
Fix data property terminology (mdn#25447)
Browse files Browse the repository at this point in the history
* Fix data property terminology

* Update index.md

* Update index.md

---------

Co-authored-by: Joshua Chen <[email protected]>
  • Loading branch information
geryogam and Josh-Cena authored Mar 19, 2023
1 parent 113450b commit c6ea59e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ Object.defineProperty(o, "b", {

### Adding properties and default values

It is important to consider the way default values of attributes are applied. There is often a difference between using dot notation to assign a value and using `Object.defineProperty()`, as shown in the example below.
It is important to consider the way default values of attributes are applied. There is often a difference between using [property accessors](/en-US/docs/Web/JavaScript/Reference/Operators/Property_Accessors) to assign a value and using `Object.defineProperty()`, as shown in the example below.

```js
const o = {};
Expand Down Expand Up @@ -471,7 +471,7 @@ a.x = 1;
console.log(b.x); // undefined
```

Unlike accessor properties, value properties are always set on the object itself, not on a prototype. However, if a non-writable value property is inherited, it is still prevented from being modified on the object.
Unlike accessor properties, data properties are always set on the object itself, not on a prototype. However, if a non-writable data property is inherited, it is still prevented from being modified on the object.

```js
function MyClass() {}
Expand Down

0 comments on commit c6ea59e

Please sign in to comment.