Skip to content

Commit

Permalink
fix private features' link in classes overview page (mdn#32206)
Browse files Browse the repository at this point in the history
* fix private features' link in classes overview page

* Update files/en-us/web/javascript/reference/classes/index.md

---------

Co-authored-by: Joshua Chen <[email protected]>
  • Loading branch information
Ahmed-Hakeem and Josh-Cena authored Feb 10, 2024
1 parent 0fe8f4d commit 1f39f65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion files/en-us/web/javascript/reference/classes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class Rectangle {
}
```

Class fields are similar to object properties, not variables, so we don't use keywords such as `const` to declare them. In JavaScript, [private features](#private_class_features) use a special identifier syntax, so modifier keywords like `public` and `private` should not be used either.
Class fields are similar to object properties, not variables, so we don't use keywords such as `const` to declare them. In JavaScript, [private features](#private_class_features_2) use a special identifier syntax, so modifier keywords like `public` and `private` should not be used either.

As seen above, the fields can be declared with or without a default value. Fields without default values default to `undefined`. By declaring fields up-front, class definitions become more self-documenting, and the fields are always present, which help with optimizations.

Expand Down

0 comments on commit 1f39f65

Please sign in to comment.