Skip to content

Commit

Permalink
Renamed "bracket" to "parenthesis" (#29481)
Browse files Browse the repository at this point in the history
* Renamed "bracket" to "parenthesis"

[The term bracket has different connotations depending on the users dialect](https://www.wordhippo.com/what-is/the-meaning-of-the-word/bracket.html):

> Any of the characters "(", ")", "[", "]", "parenthetic remarks, sections of mathematical expressions, etc.
>
> 1. (Britain) "(" and ")" specifically, the other forms above requiring adjectives for disambiguation.
> 2. (US) "[" and "]" specifically - opposed to the other forms of which have their own technical names.

In the context of this article, using the word "parenthesis" may reduce confusion because it usually means round brackets, and that's what this article means when it says "brackets."

* Fix others

* Fix

---------

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
  • Loading branch information
DanKaplanSES and Josh-Cena committed Oct 4, 2023
1 parent 732ac4c commit e3faa37
Show file tree
Hide file tree
Showing 42 changed files with 55 additions and 55 deletions.
Expand Up @@ -161,7 +161,7 @@ for (const cat of cats) {
In this example, `for (const cat of cats)` says:

1. Given the collection `cats`, get the first item in the collection.
2. Assign it to the variable `cat` and then run the code between the curly brackets `{}`.
2. Assign it to the variable `cat` and then run the code between the curly braces `{}`.
3. Get the next item, and repeat (2) until you've reached the end of the collection.

### map() and filter()
Expand Down
Expand Up @@ -426,10 +426,10 @@ This is because of the loop. The line `const fruits = ['apples', 'bananas', 'che
A `for...of` loop gives you a way to get each item in the array and run some JavaScript on it. The line `for (const fruit of fruits)` says:

1. Get the first item in `fruits`.
2. Set the `fruit` variable to that item, then run the code between the `{}` brackets.
2. Set the `fruit` variable to that item, then run the code between the `{}` curly braces.
3. Get the next item in `fruits`, and repeat 2, until you reach the end of `fruits`.

In this case, the code inside the brackets is writing out `fruit` to the console.
In this case, the code inside the curly braces is writing out `fruit` to the console.

Now let's look at the loop in our number guessing game — the following can be found inside the `resetGame()` function:

Expand Down
4 changes: 2 additions & 2 deletions files/en-us/learn/javascript/objects/basics/index.md
Expand Up @@ -176,7 +176,7 @@ person.age;
person.name.first;
```

You can instead use brackets:
You can instead use square brackets:

```js
person["age"];
Expand All @@ -187,7 +187,7 @@ This looks very similar to how you access the items in an array, and it is basic
It is no wonder that objects are sometimes called **associative arrays** — they map strings to values in the same way that arrays map numbers to values.

Dot notation is generally preferred over bracket notation because it is more succinct and easier to read.
However there are some cases where you have to use brackets.
However there are some cases where you have to use square brackets.
For example, if an object property name is held in a variable, then you can't use dot notation to access the value, but you can access the value using bracket notation.

In the example below, the `logProperty()` function can use `person[propertyName]` to retrieve the value of the property named in `propertyName`.
Expand Down
Expand Up @@ -325,7 +325,7 @@ Now you can create a new virtual environment with the `mkvirtualenv` command

Once you've installed _virtualenvwrapper_ or _virtualenvwrapper-win_ then working with virtual environments is very similar on all platforms.

Now you can create a new virtual environment with the `mkvirtualenv` command. As this command runs you'll see the environment being set up (what you see is slightly platform-specific). When the command completes the new virtual environment will be active — you can see this because the start of the prompt will be the name of the environment in brackets (below we show this for Ubuntu, but the final line is similar for Windows/macOS).
Now you can create a new virtual environment with the `mkvirtualenv` command. As this command runs you'll see the environment being set up (what you see is slightly platform-specific). When the command completes the new virtual environment will be active — you can see this because the start of the prompt will be the name of the environment in parentheses (below we show this for Ubuntu, but the final line is similar for Windows/macOS).

```bash
mkvirtualenv my_django_environment
Expand Down
Expand Up @@ -308,7 +308,7 @@ The main parts of the syntax you will need to know for declaring the pattern mat
<tr>
<td>( )</td>
<td>
Capture the part of the pattern inside the brackets. Any captured values
Capture the part of the pattern inside the parentheses. Any captured values
will be passed to the view as unnamed parameters (if multiple patterns
are captured, the associated parameters will be supplied in the order
that the captures were declared).
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/learn/server-side/django/introduction/index.md
Expand Up @@ -144,7 +144,7 @@ def index(request):
> **Note:** A little bit of Python:
>
> - [Python modules](https://docs.python.org/3/tutorial/modules.html) are "libraries" of functions, stored in separate files, that we might want to use in our code. Here we import just the `HttpResponse` object from the `django.http` module so that we can use it in our view: `from django.http import HttpResponse`. There are other ways of importing some or all objects from a module.
> - Functions are declared using the `def` keyword as shown above, with named parameters listed in brackets after the name of the function; the whole line ends in a colon. Note how the next lines are all **indented**. The indentation is important, as it specifies that the lines of code are inside that particular block (mandatory indentation is a key feature of Python, and is one reason that Python code is so easy to read).
> - Functions are declared using the `def` keyword as shown above, with named parameters listed in parentheses after the name of the function; the whole line ends in a colon. Note how the next lines are all **indented**. The indentation is important, as it specifies that the lines of code are inside that particular block (mandatory indentation is a key feature of Python, and is one reason that Python code is so easy to read).
Views are usually stored in a file called **views.py**.

Expand Down
Expand Up @@ -240,7 +240,7 @@ Svelte uses the [`export`](/en-US/docs/Web/JavaScript/Reference/Statements/expor

### The markup section

In the markup section you can insert any HTML you like, and in addition you can insert valid JavaScript expressions inside single curly brackets (`{}`). In this case we are embedding the value of the `name` prop right after the `Hello` text.
In the markup section you can insert any HTML you like, and in addition you can insert valid JavaScript expressions inside single curly braces (`{}`). In this case we are embedding the value of the `name` prop right after the `Hello` text.

```html
<main>
Expand Down
Expand Up @@ -818,7 +818,7 @@ Our stores have already been ported to TypeScript, but we can do better. We shou
### Understanding TypeScript generics
Generics allow us to create reusable code components that work with a variety of types instead of a single type. They can be applied to interfaces, classes, and functions. Generic types are passed as parameters using a special syntax: they are specified between angle-brackets, and by convention are denoted with an upper-cased single char letter. Generic types allows us to capture the types provided by the user to be used later.
Generics allow us to create reusable code components that work with a variety of types instead of a single type. They can be applied to interfaces, classes, and functions. Generic types are passed as parameters using a special syntax: they are specified between angle brackets, and by convention are denoted with an upper-cased single char letter. Generic types allows us to capture the types provided by the user to be used later.
Let's see a quick example, a simple `Stack` class that lets us `push` and `pop` elements, like this:
Expand Down
Expand Up @@ -313,7 +313,7 @@ Create your method pages as subpages of the interface they are implemented on. C

Method pages need the following sections:

1. **Title**: the title of the page must be **InterfaceName.method()** (with the two terminal parentheses), but the slug (the end of the page URL) must not include the brackets. Also the interface name must start with a capital. Although an interface is implemented in JavaScript on the prototype of objects, we don't put `.prototype.` in the title, like we do in the [JavaScript reference](/en-US/docs/Web/JavaScript/Reference).
1. **Title**: the title of the page must be **InterfaceName.method()** (with the two terminal parentheses), but the slug (the end of the page URL) must not include the parentheses. Also the interface name must start with a capital. Although an interface is implemented in JavaScript on the prototype of objects, we don't put `.prototype.` in the title, like we do in the [JavaScript reference](/en-US/docs/Web/JavaScript/Reference).
2. **\\{{APIRef}}**: Include the \\{{APIRef}} macro in the first line of each method page, including the name of the API as an argument, so for example \\{{APIRef("Web Audio API")}}. This macro serves to construct a reference menu on the left-hand side of the interface page, including properties and methods, and other quick links as defined in the [GroupData](https://github.com/mdn/content/blob/main/files/jsondata/GroupData.json) macro (ask someone to add your API to an existing GroupData entry, or to create a new one, if it isn't already listed there). The menu will look something like the below screenshot.
![This screenshot shows a vertical navigation menu for the OscillatorNode interface, with multiple sublists for methods and properties, as generated by the APIRef macro ](apiref-links.png)
3. **Standardization status**: Next, the banner indicating the standardization status should be added (these can be placed on the same line as the \\{{APIRef}} macro):
Expand Down
Expand Up @@ -71,7 +71,7 @@ Domains specified in `initiatorDomains`, `excludedInitiatorDomains`, `requestDom
- The entries must consist of only _lowercase_ ASCII characters.
- Use [Punycode](https://en.wikipedia.org/wiki/Punycode) encoding for internationalized domains.
- IPv4 addresses must be represented as 4 numbers separated by a dot.
- IPv6 addresses should be represented in their canonical form, wrapped in brackets.
- IPv6 addresses should be represented in their canonical form, wrapped in square brackets.

To programmatically generate the canonical domain for a URL, use the [URL API](/en-US/docs/Web/API/URL) and read its `hostname` property, i.e., `new URL(url).hostname`.

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/mozilla/firefox/releases/27/index.md
Expand Up @@ -31,7 +31,7 @@ More details in [this post](https://hacks.mozilla.org/2013/11/firefox-developer-
- Experimental support of `position:sticky` is now active by default on non-release builds ([Firefox bug 902992](https://bugzil.la/902992)). For releases builds, the `layout.css.sticky.enabled` preference still needs to be set to `true`.
- The {{cssxref("all")}} shorthand property has been added ([Firefox bug 842329](https://bugzil.la/842329)).
- The {{cssxref("unset")}} global value has been added; it allows to reset any CSS property ([Firefox bug 921731](https://bugzil.la/921731)).
- Curly brackets are no longer allowed in HTML `style` attributes: doing `<div style="{ display: none }">` was working in quirks mode, but won't anymore [Firefox bug 915053](https://bugzil.la/915053).
- Curly braces are no longer allowed in HTML `style` attributes: doing `<div style="{ display: none }">` was working in quirks mode, but won't anymore [Firefox bug 915053](https://bugzil.la/915053).
- The {{cssxref("overflow")}} property now works on {{HTMLElement("fieldset")}} ([Firefox bug 261037](https://bugzil.la/261037)).

### HTML
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/htmlselectelement/index.md
Expand Up @@ -63,9 +63,9 @@ _This interface inherits the methods of {{domxref("HTMLElement")}}, and of {{dom
- {{domxref("HTMLSelectElement.focus()")}} {{deprecated_inline}}
- : Gives input focus to this element. _This method is now implemented on {{domxref("HTMLElement")}}_.
- {{domxref("HTMLSelectElement.item()")}}
- : Gets an item from the options collection for this {{HTMLElement("select")}} element. You can also access an item by specifying the index in array-style brackets or parentheses, without calling this method explicitly.
- : Gets an item from the options collection for this {{HTMLElement("select")}} element. You can also access an item by specifying the index in square brackets or parentheses, without calling this method explicitly.
- {{domxref("HTMLSelectElement.namedItem()")}}
- : Gets the item in the options collection with the specified name. The name string can match either the `id` or the `name` attribute of an option node. You can also access an item by specifying the name in array-style brackets or parentheses, without calling this method explicitly.
- : Gets the item in the options collection with the specified name. The name string can match either the `id` or the `name` attribute of an option node. You can also access an item by specifying the name in square brackets or parentheses, without calling this method explicitly.
- {{domxref("HTMLSelectElement.remove()")}}
- : Removes the element at the specified index from the options collection for this `select` element.
- {{domxref("HTMLSelectElement.reportValidity()")}}
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/window/alert/index.md
Expand Up @@ -38,7 +38,7 @@ alert("Hello world!");

Both produce:

![Black alert dialog box. At the top left small circle icon follow by white open and close brackets containing this white text: JavaScript application. Below on the left, a Hello world! white text. And on the bottom right a small blue button. The button's text is: ok in black.](alerthelloworld.png)
![Black alert dialog box. At the top left small circle icon follow by white open and close square brackets containing this white text: JavaScript application. Below on the left, a Hello world! white text. And on the bottom right a small blue button. The button's text is: ok in black.](alerthelloworld.png)

## Notes

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/css/@import/index.md
Expand Up @@ -108,7 +108,7 @@ The `@import` rules in the above examples show media-dependent conditions that w
The `@import` rules above illustrate how you might import a layout that uses a grid if `display: grid` is supported, and otherwise imports CSS that uses `display: flex`.
While you can only have one `supports()` statement, you can combine any number of feature checks with `not`, `and`, and `or`, as long as you wrap each condition to be tested in parentheses.
You can also use parentheses to indicate precedence.
Note that if you just have a single declaration then you don't need to wrap it in additional brackets: this is shown in the first example above.
Note that if you just have a single declaration then you don't need to wrap it in additional parenthese: this is shown in the first example above.

The examples above show support conditions using simple declaration syntax.
You can also specify CSS functions in `supports()`, and it will evaluate to `true` if they are supported and can be evaluated on the user-agent.
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/css/css_shapes/basic_shapes/index.md
Expand Up @@ -15,7 +15,7 @@ Before looking at shapes, it is worth understanding two pieces of information th

## The \<basic-shape> type

The `<basic-shape>` type is used as the value for all of our basic shapes. This type uses Functional Notation: the type of shape is followed by brackets, inside of which are additional values used to describe the shape.
The `<basic-shape>` type is used as the value for all of our basic shapes. This type uses Functional Notation: the type of shape is followed by parenthese, inside of which are additional values used to describe the shape.

The arguments which are accepted vary depending on the shape that you are creating. We will cover these in the examples below.

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/css/round/index.md
Expand Up @@ -83,7 +83,7 @@ The height of the boxes is therefore either rounded up to 125 px or down to 100
#### HTML

The HTML defines 5 `div` elements that will be rendered as boxes by the CSS.
The elements contain text indicating the rounding strategy, initial value, and expected final height of the box (in brackets).
The elements contain text indicating the rounding strategy, initial value, and expected final height of the box (in parentheses).

```html
<div class="box box-1">height: 100px</div>
Expand Down
Expand Up @@ -22,7 +22,7 @@ for complete information about expressions.
## Block statement

The most basic statement is a _block statement_, which is used to group
statements. The block is delimited by a pair of curly brackets:
statements. The block is delimited by a pair of curly braces:

```js
{
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/javascript/guide/functions/index.md
Expand Up @@ -18,7 +18,7 @@ A **function definition** (also called a **function declaration**, or **function

- The name of the function.
- A list of parameters to the function, enclosed in parentheses and separated by commas.
- The JavaScript statements that define the function, enclosed in curly brackets, `{ /* … */ }`.
- The JavaScript statements that define the function, enclosed in curly braces, `{ /* … */ }`.

For example, the following code defines a simple function named `square`:

Expand Down
Expand Up @@ -225,7 +225,7 @@ const fruits = ["Apple", "Watermelon", "Orange", "Avocado", "Strawberry"];
// In this example, two meanings of '^' control symbol are represented:
// 1) Matching beginning of the input
// 2) A negated or complemented character class: [^A]
// That is, it matches anything that is not enclosed in the brackets.
// That is, it matches anything that is not enclosed in the square brackets.

const fruitsStartsWithNotA = fruits.filter((fruit) => /^[^A]/.test(fruit));

Expand Down
Expand Up @@ -57,7 +57,7 @@ Character classes distinguish kinds of characters such as, for example, distingu
<td>
<p>
A negated or complemented character class. That is, it matches
anything that is not enclosed in the brackets. You can specify a range
anything that is not enclosed in the square brackets. You can specify a range
of characters by using a hyphen, but if the hyphen appears as the
first character after the <code>^</code> or the last character enclosed in the square brackets, it is taken as
a literal hyphen to be included in the character class as a normal
Expand Down
Expand Up @@ -58,7 +58,7 @@ This page provides an overall cheat sheet of all the capabilities of `RegExp` sy
<td>
<p>
A negated or complemented character class. That is, it matches
anything that is not enclosed in the brackets. You can specify a range
anything that is not enclosed in the square brackets. You can specify a range
of characters by using a hyphen, but if the hyphen appears as the
first or last character enclosed in the square brackets, it is taken as
a literal hyphen to be included in the character class as a normal
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/javascript/guide/text_formatting/index.md
Expand Up @@ -82,7 +82,7 @@ hello[0] = "L"; // This has no effect, because strings are immutable
hello[0]; // This returns "H"
```

Characters whose Unicode scalar values are greater than U+FFFF (such as some rare Chinese/Japanese/Korean/Vietnamese characters and some emoji) are stored in UTF-16 with two surrogate code units each. For example, a string containing the single character U+1F600 "Emoji grinning face" will have length 2. Accessing the individual code units in such a string using brackets may have undesirable consequences such as the formation of strings with unmatched surrogate code units, in violation of the Unicode standard. (Examples should be added to this page after MDN bug 857438 is fixed.) See also {{jsxref("String.fromCodePoint()")}} or {{jsxref("String.prototype.codePointAt()")}}.
Characters whose Unicode scalar values are greater than U+FFFF (such as some rare Chinese/Japanese/Korean/Vietnamese characters and some emoji) are stored in UTF-16 with two surrogate code units each. For example, a string containing the single character U+1F600 "Emoji grinning face" will have length 2. Accessing the individual code units in such a string using square brackets may have undesirable consequences such as the formation of strings with unmatched surrogate code units, in violation of the Unicode standard. (Examples should be added to this page after MDN bug 857438 is fixed.) See also {{jsxref("String.fromCodePoint()")}} or {{jsxref("String.prototype.codePointAt()")}}.

A `String` object has a variety of methods: for example those that return a variation on the string itself, such as `substring` and `toUpperCase`.

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/javascript/language_overview/index.md
Expand Up @@ -413,7 +413,7 @@ const obj = {
};
```

Object properties can be [accessed](/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors) using dot (`.`) or brackets (`[]`). When using the dot notation, the key must be a valid [identifier](/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#identifiers). Brackets, on the other hand, allow indexing the object with a dynamic key value.
Object properties can be [accessed](/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors) using dot (`.`) or square brackets (`[]`). When using the dot notation, the key must be a valid [identifier](/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#identifiers). Square brackets, on the other hand, allow indexing the object with a dynamic key value.

```js
// Dot notation
Expand Down

0 comments on commit e3faa37

Please sign in to comment.